Quad Core
At a Glance
  • Time Frame:
  • July 14, 2017 - July 16, 2017

  • Roles:
  • Lead Game Designer - Engineering Lead - Level Designer

  • Technology:
  • Unity - Visual Studio - C#

Summary

Quad Core is a 3D side scrolling platformer with a slight twist on how the player jumps. Instead of pressing a button to jump, the player has to fire a projectile at a target; upon breaking the target, the player is boosted into the air. The player must race against time utilizing this unique jump mechanic and other interesting gameplay elements to reach the finish. Over the course of a weekend, I and three other group members finished a mechanically fulfilled game complete with three distinct levels. This project was the result of our participation in a video game jam hosted by Mark Brown for his youtube channel Game Maker’s Toolkit.

Details

The idea behind Quad Core spawned from the requirements of the game jam that we were participating in. The driving purpose of the jam was to create a game based on the concept behind one of the videos on Mark Brown’s youtube channel: https://www.youtube.com/watch?v=i5C1Uj7jJCg. The gist of the video is about designing mechanics that have multiple purposes. From this I thought if the player could only move and shoot a projectile, how would he or she maneuver through a platformer style level? Using this thought as a basis, I came up with multiple purposes for the player’s projectile: shooting a red target makes the player jump, shooting a green target teleports the player, shooting a special platform makes the platform move. Using only the projectile and moving side to side, the player must navigate through a level to reach the end. After the core mechanic of the game was decided, we sprinkled in a few extra things to make it more interesting: collectible star fragments, enemies trying to shoot the player, time trial to complete the level, and a weapon that lets the player launch and drone from which the player can shoot projectiles.

Projectiles

Coupled with the ability to move side to side, the player’s projectile is the only way to maneuver through the levels in Quad Core. Aiming with the mouse and pressing the left mouse button, fires a projectile from the character’s hand. When the projectile hits a red drone, the player is launched into the air. This is how the player “jumps” from platform to platform. Hitting a green drone teleports the player to the position of the drone. Shooting a platform with an arrow on it moves the platform in the direction of the arrow. The player can reposition platforms to expand the level. If the player is on the platform, he or she will move with it. In addition to the normal projectile, the player can shoot a green gun icon within the level to activate a turret gun. The turret gun fires a drone to the position the player is aiming at. The player can then shoot normal projectiles from the position of the drone. This feature allows for more intricate puzzle design. The turret.cs class is an example of how the drone is launched into position.

Turret.cs Example

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Turret : MonoBehaviour
{
    [System.NonSerialized]
    public Vector3 targetPosition;

    [System.NonSerialized]
    public Camera cam2D;

    [System.NonSerialized]
    public Player player;

    public GameObject bullet;
    public AudioClip shootSound;

    float fireRate = .5f;
    float shootingTimer = 0f;

    AudioSource audioSource;

    void Start ()
    {
		// get audio source to play fire shoot sound
        audioSource = GetComponent();
		
		// initialize target position
        targetPosition.x -= (player.transform.position.x - targetPosition.x) / 8;
        targetPosition.y -= (player.transform.position.y - targetPosition.y) / 8;
    }

    void Update ()
	{
		// moves towards target position
		if(transform.position != targetPosition)
        {
            transform.position = Vector3.Lerp(transform.position, targetPosition, Time.deltaTime * 3);
        }

		// if turret has reached its target position
        if(Vector3.Distance(transform.position, targetPosition) < .5f)
        {
			// get player mouse position and look towards it
            Vector3 mousePos = cam2D.ScreenToWorldPoint(Input.mousePosition);
            mousePos.x -= (player.transform.position.x - transform.position.x) / 8;
            mousePos.y -= (player.transform.position.y - transform.position.y) / 8;
            mousePos.z = 0;

            transform.LookAt(mousePos);

			// fire projectile
            if (Input.GetButtonDown("Fire1"))
            {
                if (shootingTimer == 0)
                {
                    Shoot();
                }
            }

			// set cool down
            if (shootingTimer > 0)
            {
                shootingTimer -= Time.deltaTime;
            }
            else
            {
                shootingTimer = 0;
            }
        }
	}

    void Shoot ()
    {
        shootingTimer = fireRate;
		
        Vector3 mousePos = cam2D.ScreenToWorldPoint(Input.mousePosition);
        mousePos.x -= (player.transform.position.x - transform.position.x) / 8;
        mousePos.y -= (player.transform.position.y - transform.position.y) / 8;
        mousePos.z = 0;
		
		// get direction to fire projectile in
        Vector3 dir = mousePos - transform.position;
        dir.Normalize();
		
		// create projectile and set direction
        GameObject b = Instantiate(bullet, transform.position, Quaternion.identity) as GameObject;
        b.GetComponent().direction = new Vector3(dir.x, dir.y, 0);
        b.GetComponent().p = player;
		
        audioSource.PlayOneShot(shootSound);
    }

    void OnTriggerEnter(Collider c)
    {
		// destroy if it collides with anything unfriendly 
        if (c.tag != "Player" && c.tag != "Bullet" && c.tag != "Weapon")
        {
            Destroy(gameObject);
        }
    }
}