Optional Lesson 5.5 - Classes
This section will cover how to use a class to more easily store and process game entities.
Lesson 6 - Animating Part 2 Classes
What to Do?
1 - Open up your program from Animation Part 1. We will be starting from here. If you don't have a complete working version, here is a solution to it:
https://github.com/AldworthClass/Part-3---Animation-Part-1
2 - Complete the tutorial Animation and Classes.
Text version, video version or follow along in class.
Youtube Link:
GitHub program solution:
3 - Complete the Your Tasks section of the tutorial. See the tutorial for more detail.
Add at least 3 more tribbles to your program by declaring and constructing more Tribble objects.
Use random numbers to initialize their speeds, sizes and textures.
Add a sound so when a tribble hits a wall it plays a 'coo'. The sound file tribble_coo.mp3 can be found in the 'Files' section.
You may play the sound in the Game.cs file, or incorporate the sound into your Tribble class.
4 - Complete optional challenges if you can.
Add a second constructor to your Tribble class that creates a tribble at a random location that travels at a random speed. It should only take in a Texture2D as parameter. Everything else can be initialized in the constructor.
Move the collision detection with the wall from your Game1.cs file and put it in the Move() method.
Your Tribble class will need access to the dimensions of your game window. Either make it a field in the Tribble class, or pass it as a parameter to the Move() method.
Instead of having a tribble bounce off the wall, have it appear on the other side of the window. Similar to the challenge from Lesson 3 - Animation.
Make a list of tribbles and animate them with loops.
This is covered in the video.
What to Submit?
1 - The completed programming task described in the tutorial, along with any completed challenges.