Skip to content

HW Week 7.2

Kayla Robertson edited this page Oct 24, 2016 · 21 revisions

Homework, Week 7.2 -- Object Awareness

The Final version will be due by Wed, Oct 19th

Choose one of the following two HW specifications

PacMan

  1. Create a PacMan class.
    • This class should be capable of drawing a PacMan whose mouth and eyes point in the correct direction that it is traveling.
    • This PacMan can only travel in straight lines according to the compass rose (ie. North, South, East, West).
    • This PacMan class should have a random timer. Once the timer is up, the PacMan changes direction. And the timer resets to a new random amount of time between 0-4”.
    • The PacMan should never repeat the same direction it is already traveling.
    • If the PacMan hits a boundary before the timer is up, the PacMan should stay at the boundary until a new direction is chosen.
  2. PacMan awareness.
    • Your sketch should create 5 PacMan Objects.
    • Additionally, these PacMan’s should be aware of each other, such that if they run in to each other they stop moving until the path is free again. This means that if two PacMan hit head on, they will not move again until the random timer triggers a new direction move.
  3. Food Class (Optional)
    • Create a food class like in the original PacMan
    • The food objects should cover a grid of the entire sketch canvas
    • Once a PacMan crosses over a food object, it should disappear

Michaels Example

Here is my example Sketch of what this might look like

Questions

Add your homework here

Clone this wiki locally