Published using Google Docs
GDD1 2020 Assignment1
Updated automatically every 5 minutes

Game Design & Development 1

2020 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 2019.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. Alternatively you can also let the player collect the item (by touching) and press a button to activate it. The item hereby shrinks the player to half his/her size on picking it up.
  9. Enemies dodging projectiles. The feature adds the ability to the enemies to dodge incoming projectiles.
  10. Time Stop collectible (á la 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

The target frame rate is 30 FPS or more on a PC built from the most used gaming hardware in the most recent Steam Hardware Survey. To measure the FPS just use the provided FPS indicator script (see below). To measure the FPS just use the package provided in Discord. Make sure that you achieve the target frame rate before submitting your game.

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)

Submit your game in the TeachCenter!

Deadline

October 23th, 2020 11:59 PM (= 23:59)

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.

We uploaded a unity package to the discord gdd channel instead of this, please include the package instead and have a look at discord for all the details.

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

}