Game Design & Development 1

2019 Assignment 1

Individual Assignment 1

Description

Extensions

Deliverable

Deadline

Mandatory Script

Individual Assignment 1

Description

Your task is to create a classic little 2D side scrolling Shmup (“Shoot’em up”, think R-Type, Gradius, etc.) game with Unity to get a hold of game development basics.

The basic features it has to contain are:

For this task we would recommend using Unity 2018.4.x LTS (Long Term Support) version. The visual assets and sounds can be created by yourself in any way you like or you can use any of the many freely available asset packs there are.

You’re free to use any literature or tutorials to complete this task, one tutorial we’d recommend as a starting point is this one: https://pixelnest.io/tutorials/2d-game-unity/

Albeit written for an older Unity version it should easily be possible to adapt to a current version.

Extensions

We’ve come up with a pool of 10 additional features to implement with the basic shmup gameplay. Every student has to choose 2 features to implement, based on the following rules:

List of additional features:

  1. Fire projectiles: The feature adds the ability to the player character to shoot fire projectiles. An enemy hit by a fire projectile takes damage over the timespan of 2 seconds. The visuals should show that state accordingly (“enemy on fire”).
  2. Ice projectiles: The feature adds the ability to the player character to shoot ice projectiles. An enemy hit by an ice projectile is unable to move for 2 seconds. The visuals should show that state accordingly (“enemy frozen”).
  3. Homing projectile: Implement a special projectile which automatically targets and steers towards the nearest or a randomly chosen enemy. The visuals for this one should be different from regular or other types of projectiles.
  4. Exploding projectile: Create a special type of projectile which explodes if it hits an enemy and then does area damage, which means it hurts every enemy within a certain radius from the impact point. Choose visuals which clearly communicate to the player where damage is applied.
  5. Ship selection: Add a simple player character selection screen with 2 choices before starting the game. The 2 chooseable player characters should be different in regards to visuals as well as moving speed and projectile damage.
  6. Laser weapon: Implement an additional laser weapon which fires a continuous ray across the screen for 2 seconds, every enemy touched by the ray takes damage. Has a recharge time of 4 seconds.
  7. 2 Player local coop mode (No network!). Include a 2 player mode, with 2 character players on the screen at once, both controllable via the same keyboard for 2 players sitting next to each other. The players play together against enemies to complete the game.
  8. Shrink item. The feature adds the ability to the player character to pick up a randomly spawning item by touching it and pressing a button at the same time. The item hereby shrinks the player to half his/her size on picking it up.
  9. Enemies dodging projectiles. The features adds the ability to the enemies to dodge incoming projectiles.
  10. Time Stop collectible (ala Matrix). This feature adds a randomly spawning item that the player can pick up by touching it. The item itself stops the time for 5 seconds and lets the player shoot the enemies meanwhile.

Bonus:

  1. 3 seconds time rewind (“Braid”).
  2. Add an Assassin's Creed themed mechanic
  3. Use your own Sprite Shader like “Outline”, “NormalMap Lightning”, “Sprite Deformation”, “Ghost Trail”, …
  4. Use a parallax effect for the background.

Deliverable

Once done implementing your game please deploy a WebGL build out of Unity.

You’re responsible for uploading and hosting your WebGL build, we recommend using github pages:

https://pages.github.com/ (Create a user site if not done already and then create a project site for your game, there you can host your Unity WebGL build)

To submit your game, use the following form and fill in the necessary information:

https://forms.gle/ZNfA3aD4d8uPBJrh7

Deadline

October 25th, 2019 11:59 PM (= 23:59)

Extended Deadline: October 30th, 2019 11:50 PM (= 23:59).

We decided to extend the deadline for assignment 1 until Wednesday the 30th 23:59. BUT with the following restriction: For every additional day you need, you have to implement two additional features of our pool (bonus features also count).

Mandatory Script

We provide a FPS indicator script which needs to be included by everybody. Paste the following code into a newly created FramesPerSecond.cs file inside Unity and attach this script to any top-level Hierarchy gameobject in your scene.

using System.Collections;

using System.Threading;

using UnityEngine;

public class FramesPerSecond : MonoBehaviour

{

  #region Variables

  [SerializeField] private Color textColor = Color.red;

  private float TargetRate = 30.0f;

  Rect fpsRect;

  GUIStyle style;

  float fps = 0.0f;

  float currentFrameTime;

  #endregion

  #region Unity callbacks

  //----------------------------------------------------------------------------

  void Start()

  {

    fpsRect = new Rect(50, 50, 400, 100);

    style = new GUIStyle();

    style.fontSize = 30;

    style.normal.textColor = textColor;

    QualitySettings.vSyncCount = 0;

    Application.targetFrameRate = 9999;

    currentFrameTime = Time.realtimeSinceStartup;

    StartCoroutine(RecalculateFPS());

    StartCoroutine(WaitForNextFrame());

  }

  //----------------------------------------------------------------------------

  private void OnGUI()

  {

    GUI.Label(fpsRect, "FPS: " + string.Format("{0:0.0}", fps), style);

  }

  #endregion

  #region Force And [Re]Calculate FPS

  //----------------------------------------------------------------------------

  private IEnumerator RecalculateFPS()

  {

    while (true)

    {

      yield return new WaitForSeconds(1);

      fps = 1.0f / Time.deltaTime;

    }

  }

  //----------------------------------------------------------------------------

  private IEnumerator WaitForNextFrame()

  {

    while (true)

    {

      yield return new WaitForEndOfFrame();

      currentFrameTime += 1.0f / TargetRate;

      var t = Time.realtimeSinceStartup;

      var sleepTime = currentFrameTime - t - 0.01f;

      if (sleepTime > 0)

        Thread.Sleep((int)(sleepTime * 1000));

      while (t < currentFrameTime)

        t = Time.realtimeSinceStartup;

    }

  }

  #endregion

}