Difference between revisions of "CS1 3rd Quarter Exam"
From WLCS
(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...) |
|||
Line 14: | Line 14: | ||
# Your ball should fall from the top to the bottom of the screen | # Your ball should fall from the top to the bottom of the screen | ||
# Inside your game loop, if the ball reaches past the bottom of the screen, then... | # Inside your game loop, if the ball reaches past the bottom of the screen, then... | ||
− | #* Reset its y-coordinate to | + | #* Reset its y-coordinate back to the top of the screen |
− | #* Randomize its x-coordinate | + | #* Randomize its x-coordinate between 0 and 800 (or however wide the screen is) |
'''Successful dodge counter (5 points):''' | '''Successful dodge counter (5 points):''' |
Revision as of 08:35, 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):
- Draw a Box (50x50 pixels) at the bottom middle of the screen and save it in a variable named player
- Your player should be able to ONLY move left and right
- 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):
- Draw a Circle (25 pixel radius) at the top of the screen and save it in a variable named ball
- Create a dy variable that is a random number between 5 and 20
- Your ball should fall from the top to the bottom of the screen
- 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 100 falling objects, then there should be a win message
Bonus (5 points):
- Create 8+ falling objects that all work