Follow-Along Project

The following project is for students to follow along with and create a project with me, one that focuses on actually making an entire thing that has multiple levels and a game state.

Playlist of videos.

Part 1 #

This part we think of our game, make a todo list, use Unity’s tilemap system to create a level, and create a player movement system. We write our first recursive function, and we manage picking up items as we move. We also flounder about with particles.

Additional Resources:

Part 2 #

This is the real meat of this assignment, so to speak.

This part we create a game manager which keeps track of the state of the game, which other systems listen to. We make an interactable component that helps compartmentalize functionality (and a future use-case of OOP), We also set up a basic UI to demonstrate this things. I struggle with variable names.


  • I also said at the beginning that we would not use ScriptableObjects, but I changed my mind when I got to part 3.
  • I forgot to move all my code to it’s own namespace(s), but we should do that. Rider can do it automatically with it’s refactor options. In this part, I was wrong about the gear manager icon, and the reasons are interesting but not really worth getting into right now..

Additional Resources:

Part 3 #

This part we create a Level manager, first explaining a prefab approach, and getting it completely working. Then changing it to a ScriptableObject approach. The last part of this is code-cleanup. If you are following along, be aware that I write and refactor code on this part, which is an honest explanation of how programming actually works - it’s never really true that we just type everything right through from the start.

After the level manager I even remembered to finish pickups.

Here we switch from ‘we’ to ‘I’, as the “follow-along” part is no longer required. I fixed a bug (the hard way) where you lose lives when you push a direction you can’t move. After that I refactored the particle system to it’s own script. I got confused about particle systems again, and stared at a working project thinking it might be broken. Apparently they do play On Enable if Play On Awake is selected.

Additional Resources

Part 4 #

This video is less of a follow-along, but I took the less programming-centric parts of putting it together and lumped them into one video. It would be a shame not to show these parts of the process.

I use:

  • Sprite Import Settings
  • Sprite Sheets
  • Unity’s Animation system (Animator Controller and Animations)
  • Cinemachine (with Impulse and Confiner2D controller)
  • Turn the Main Menu into an actual menu screen.

Additional Resources:

Refactoring #

I think of this video really as more for reference than following along.

The project is done, but (as mentioned in previous videos) it’s in need of some refactoring using some more advanced topics. We improve the interactable system with inheritance, we improve the state system with events, we improve the flippant use of FindGameObjectOfType with more usable implementation of the singleton pattern, in this case a static instance variable. Also abstract classes I guess.

The Finished Project #

The entire finished project is available on github: