JoC #12
Adding sounds to my scenario for when each of the members of the animal class eats something. The files were already created, but if I needed to, I could record sounds here:
JoC #13
Explanations of different types of comments & the formatting of some of the syntax.
JoC #14
Adding the integer variable with a starting number of zero.
Adding the check to see if the number of lettuce eaten is now at 10 to run the gameOver method if it is.
Adding the won the game method to play a sound and stop the game.
Here you can see the variable for each turtle now that it has been added in our code.
Checks whether or not the variable is equal to 10. Double equals is important syntax here.
JoC #15
Adding a new subclass of a Bug.
Replacing trying to eat lettuce references to points.
Creating a new method that creates a new bug when the turtle eats a bug in the world.
Adding more points if the turtle eats a Bug instead of Lettuce. This time you get 5 points instead of 1.
Creating the method that creates the new bug.
This time, setting variables of the size of the world. This will work better instead of hard coding the size of the world. Instead we're using a method of the world to get the width and height.
Adding a comment to explain the method in the code of the class.
Found the bug (I think). The way that we added the bug means that now if you end up with more points than 15, but not exactly 15, the game will continue. This wasn't a problem when the intervals that the lettuce could add to the points was only 1 at a time, but now with different points added depending on which thing the turtle eats, it can. Changed my code above.
Link to my Scenario.
No comments:
Post a Comment