Difference between revisions of "Robot game"
From WLCS
m (Protected "Robot game" [edit=sysop:move=sysop]) |
|||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
'''Objective:''' | '''Objective:''' | ||
* Design and implement a game where a player may move around the screen and a robot follows it | * Design and implement a game where a player may move around the screen and a robot follows it | ||
+ | |||
+ | '''Competencies:''' | ||
+ | * 053 Write a program that uses variables and constants. | ||
+ | * 057 Write a program that uses conditional structures. | ||
+ | * 058 Write a program that uses looping structures. | ||
+ | * 061 Code a program to display graphics. | ||
+ | * 063 Code a program to animate objects. | ||
'''Requirements:''' | '''Requirements:''' | ||
− | * Colorful or non-default background image | + | * Colorful or non-default background image/drawing (optional) |
* Player sprite must be able to move around the screen with the keyboard | * Player sprite must be able to move around the screen with the keyboard | ||
− | * The screen must | + | * The screen must wrap around (see below) |
* There should be 5-10 items on the screen that the player must collect | * There should be 5-10 items on the screen that the player must collect | ||
− | * The robot sprite must follow the player around the screen | + | ** To "collect" an item, a collision should make it disappear |
+ | ** You may want to keep track of the number of items collected using a variable | ||
+ | * The robot sprite must follow the player around the screen (see below) | ||
* If the player collides with the robot, then the player loses | * If the player collides with the robot, then the player loses | ||
* If the player collects all the items, then the player wins | * If the player collects all the items, then the player wins | ||
− | '''Making the Robot | + | '''Making the Robot follow:''' |
− | * | + | # Repeat until the Robot touches the Player |
+ | # Make the Robot point in the direction of the Player | ||
+ | # Move the Robot a little | ||
+ | |||
+ | '''Making the screen wrap around:''' | ||
+ | * Moving beyond the left side of the screen will make the player appear on the right and vice versa | ||
+ | * Moving beyond the top of the screen will make the player appear on the bottom and vice versa | ||
+ | * (Hint: For the left side, check if the Player's x-coordinate is less than the left-side X, and tell the Player to goto the right-side's X and keep the Player's y-coordinate the same) | ||
+ | |||
+ | |||
+ | <!-- | ||
* You will add 4 new if statements to the same area as the player movement if statements | * You will add 4 new if statements to the same area as the player movement if statements | ||
* If the robot is to the left of the player, then you should move the robot to the right | * If the robot is to the left of the player, then you should move the robot to the right | ||
− | ** Ex. If the robot | + | ** Ex. If the robot's x-coordinate < player's x-coordinate, then increase robot's x-coordinate by 1 |
* You must do the above for all combinations of where the robot will be in relation to the player | * You must do the above for all combinations of where the robot will be in relation to the player | ||
+ | --> | ||
'''Advanced Features:''' | '''Advanced Features:''' |
Latest revision as of 10:22, 13 October 2011
Objective:
- Design and implement a game where a player may move around the screen and a robot follows it
Competencies:
- 053 Write a program that uses variables and constants.
- 057 Write a program that uses conditional structures.
- 058 Write a program that uses looping structures.
- 061 Code a program to display graphics.
- 063 Code a program to animate objects.
Requirements:
- Colorful or non-default background image/drawing (optional)
- Player sprite must be able to move around the screen with the keyboard
- The screen must wrap around (see below)
- There should be 5-10 items on the screen that the player must collect
- To "collect" an item, a collision should make it disappear
- You may want to keep track of the number of items collected using a variable
- The robot sprite must follow the player around the screen (see below)
- If the player collides with the robot, then the player loses
- If the player collects all the items, then the player wins
Making the Robot follow:
- Repeat until the Robot touches the Player
- Make the Robot point in the direction of the Player
- Move the Robot a little
Making the screen wrap around:
- Moving beyond the left side of the screen will make the player appear on the right and vice versa
- Moving beyond the top of the screen will make the player appear on the bottom and vice versa
- (Hint: For the left side, check if the Player's x-coordinate is less than the left-side X, and tell the Player to goto the right-side's X and keep the Player's y-coordinate the same)
Advanced Features:
- Teleport
- If the player presses the 'T' key on the keyboard, then the player is randomly teleported to another location on the screen
- Warping
- Place several warps (e.g. Mario warp pipes) on the screen
- If the player reaches one of these warps, then it sends the player to the other warp location
- Special Freeze Item
- Place a special item on the screen
- If the player collects the item, then the robot is frozen for a period of time and does not follow
- Difficulty levels
- If the player wins, then increase the difficulty level some how