Difference between revisions of "CS1 3rd Quarter Exam"

From WLCS
Line 23: Line 23:
 
'''Collisions (5 points):'''
 
'''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 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
+
* If the player successfully avoids 10 falling objects, then there should be a win message
  
 
'''Bonus (5 points):'''
 
'''Bonus (5 points):'''
* Create 8+ falling objects that all work
+
* Create 5+ falling objects that all work

Revision as of 09:06, 24 March 2010

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 back to the top of the screen
    • Randomize its x-coordinate between 0 and 800 (or however wide the screen is)

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 10 falling objects, then there should be a win message

Bonus (5 points):

  • Create 5+ falling objects that all work