WEEK: 12

Homework

For this homework, you are going to alter your game by defining functions and calling them in your draw method or within other functions. Again, don’t worry about collisions.

Here is an example for Homework 12.

Homework Walkthrough Video

Specifications

  1. Create a function that creates a player.
  2. Create a function to move the player using the keyboard.
  3. Create a function that draws an object to the screen when pressing the mouse.
  4. Create a function that creates multiple obstacles of different sizes and colors on the screen (okay if you still have only 2).
  5. Create different functions to move each of the obstacles around randomly around the screen. If they leave the screen, have them come back on the other side.
  6. Create a function to generate a borders around the screen.
  7. Create a function to generate the exit
  8. Create a function to display the “You win” message.
  9. Your draw() function should contain only function calls created earlier, along with the background function.
  10. Ignore all collisions.
  11. Complete the Kahoot Challenge, take a screenshot and upload it to your repository.
  12. Submit your repository link to Moodle.

Previous section: