CS1 3rd Quarter Exam

From WLCS
Revision as of 08:24, 24 March 2010 by Admin (talk | contribs) (New page: ===Objective:=== * Design and implement a game where a player may move side to side on the screen in order to dodge falling objects * This exam is open-book, open-note, open-computer, CLOS...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Objective:

  • Design and implement a game where a player may move side to side on the screen in order to dodge falling objects
  • This exam is open-book, open-note, open-computer, CLOSED-person

Directions:

Player (5 points):

  1. Draw a Box (50x50 pixels) at the bottom middle of the screen and save it in a variable named player
  2. Your player should be able to ONLY move left and right
  3. The player may NOT leave the screen (i.e. there are walls on the left and right edges of the screen)

Falling objects (5 points):

  1. Draw a Circle (25 pixel radius) at the top of the screen and save it in a variable named ball
  2. Create a dy variable that is a random number between 5 and 20
  3. Your ball should fall from the top to the bottom of the screen
  4. Inside your game loop, if the ball reaches past the bottom of the screen, then...
    • Reset its y-coordinate to 0
    • Randomize its x-coordinate

Successful dodge counter (5 points):

  • Every time the player successfully dodges a falling object, increase a counter on the screen by one
  • HINT: A player successfully dodges if the object hits the bottom and you move it back to the top

Collisions (5 points):

  • If the player collides with a falling object (i.e. if the object hits the player), then there should be a game over message
  • If the player successfully avoids 100 falling objects, then there should be a win message

Bonus (5 points):

  • Create 8+ falling objects that all work