Game Design & Development 1
2019 Assignment 1
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.
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:
Bonus:
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
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).
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
}