Goals for this homework

  • Gain experience exploring and understanding an unfamiliar codebase
  • Gain experience with basic principles of inheritance

Setup: Download the Codebase

For this week, unlike in prior weeks, you will be provided with a fully working game as a starting point and asked to add features to it. Start by downloading the following starter code: starter code. Unpack it wherever you're storing your other Unity games, and simply open it with Unity Hub. Depending on your operating system, it may ask you to change system target - feel free to do so.

Exploration

Before you can start adding features to the game, you should take the time to understand how the codebase runs. Follow the gradescope assignment "HW4 Code Exploration" as you work through the existing codebase.

Adding features!

Now, you'll get your chance to work with the game! Follow the section Enemy_1 in Chapter 32 to implement your first enemy type, and understand how we can use inheritance to differentiate enemies. Then, once you're done, follow either Enemy_2 OR Enemy_3 to implement another enemy. Both teach you new ways to give more complex movement patterns to enemies. Enemy_2 is simpler, but Enemy_3 gives a more versatile way to define paths. Again, you only need to implement one of the two.

Next, you may have noticed that powerups don't actually do anything when collected! Follow the "Making PowerUps Affect the Hero" to add that functionality.

That's all for Part 1!

That's all for part 1. In part 2, we'll have you come up with some modifications of your own, and make those. Then, you'll submit everything together.