Lab 5 - 2D Roguelike: Game

GitHub Classroom Assignment Page

This assignment is due on Friday 5/18.

Continue off of Lab 4 for this assignment.

This lab assignment is a bit larger than previous labs because there’s not really a good stopping point near the middle. It will count for 1.5x the typical lab points. Make sure to give enough time to complete it.

In this lab we will be completing the second two-thirds or so of the 2D Roguelike tutorial.

For Lab 5 we will complete these parts:

There is a lot going on in these videos so it will most likely be necessary to compelte the lab by playing the videos and following along.

I will outline as much as I can, but mostly just to give an overview and maybe so that more experienced Unity developers can skip some parts of the videos.

Moving Object Script

Creating Destructible Walls

Player Animator Controller


Writing the Player Script

Writing the Enemy Script

Enemy Animator Controller



Adding UI & Level Transitions


// This is called each time a scene is loaded.
void OnLevelFinishedLoading(Scene scene, LoadSceneMode mode)
{
    // Add one to our level number.
    level++;

    // Call InitGame to initialize our level.
    InitGame();
}

void OnEnable()
{
    // Tell our 'OnLevelFinishedLoading' function to start listening for a scene change event as soon as this script is enabled.
    SceneManager.sceneLoaded += OnLevelFinishedLoading;
}
void OnDisable()
{
    // Tell our 'OnLevelFinishedLoading' function to stop listening for a scene change event as soon as this script is disabled.
    // Remember to always have an unsubscription for every delegate you subscribe to!
    SceneManager.sceneLoaded -= OnLevelFinishedLoading;
}