Difference between revisions of "Scratch Workshop - Item Collection & Dodge"
From WLCS
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | '''Agenda:''' | ||
+ | # Makeup class will be on Tuesday (3/10/15) at the same time and place | ||
+ | # Review Scratch blocks | ||
+ | # E-mail [mailto:jeffrey.elkner@apsva.us jeffrey.elkner@apsva.us] for attendance and tell him what you would like to cover next week | ||
+ | # Develop Item Collection & Dodge Game | ||
+ | |||
+ | |||
'''Objective:''' | '''Objective:''' | ||
* You will create a Scratch game that allows a player to travel around the screen, collect items, and avoid dangers | * You will create a Scratch game that allows a player to travel around the screen, collect items, and avoid dangers | ||
− | * Use the following | + | * Use the following [http://scratch.mit.edu/projects/49369976/ Item Collection & Dodge Template] to start your game |
+ | *# Click the link | ||
+ | *# See inside | ||
+ | *# Go to File->Save as a copy | ||
Line 34: | Line 44: | ||
# Import a new image for the items that the player will collect | # Import a new image for the items that the player will collect | ||
# When the game starts, tell the item to go to a random location (use the '''goto''' and '''random #''' block for x and y) | # When the game starts, tell the item to go to a random location (use the '''goto''' and '''random #''' block for x and y) | ||
− | # | + | # Use a forever loop to repeatedly do the following: |
− | ## it should disappear (hide) | + | ## Check if the item touches the player sprite, then: |
− | ## '''broadcast''' a message to the player sprite to say something like "yum!" | + | ### it should disappear (hide) |
− | ## increase the item count by 1 | + | ### '''broadcast''' a message to the player sprite to say something like "yum!" |
+ | ### increase the item count by 1 | ||
Line 43: | Line 54: | ||
# Import a new image for the dangerous items that the player will avoid | # Import a new image for the dangerous items that the player will avoid | ||
# When the game starts, tell the item to go to a random location (use the '''goto''' and '''random #''' block for x and y) | # When the game starts, tell the item to go to a random location (use the '''goto''' and '''random #''' block for x and y) | ||
− | # | + | # Use a forever loop to repeatedly do the following: |
− | ## it should disappear (hide) | + | ## Check if the item touches the player sprite, then: |
− | ## say "game over" | + | ### it should disappear (hide) |
− | ## stop everything in the game | + | ### say "game over" |
+ | ### stop everything in the game | ||
− | ''' | + | '''Bonus Features:''' |
* Sounds - play a sound when: | * Sounds - play a sound when: | ||
** you collect an item | ** you collect an item | ||
** collide with a danger and lose | ** collide with a danger and lose | ||
** win | ** win | ||
+ | * Moving items and dangers (make some of the items and dangers move and bounce around the screen) | ||
* Countdown timer - a time variable that starts at 10 (or another number you see fit) | * Countdown timer - a time variable that starts at 10 (or another number you see fit) | ||
** When the game starts, the time variable decreases by 1 every second | ** When the game starts, the time variable decreases by 1 every second |
Latest revision as of 13:31, 24 February 2015
Agenda:
- Makeup class will be on Tuesday (3/10/15) at the same time and place
- Review Scratch blocks
- E-mail jeffrey.elkner@apsva.us for attendance and tell him what you would like to cover next week
- Develop Item Collection & Dodge Game
Objective:
- You will create a Scratch game that allows a player to travel around the screen, collect items, and avoid dangers
- Use the following Item Collection & Dodge Template to start your game
- Click the link
- See inside
- Go to File->Save as a copy
Game Summary:
- The player will be able to move around
- The player will be able to collect items
- The player must avoid dangers like "mines" or "traps"
- The player wins when all items are picked up
- The player loses when he/she hits a dangerous item
Player Sprite:
- Import a new image or create your own player sprite image to replace the given one
- Analyze the given movement code
- Add additional code blocks to enable movement in the other directions
- Hint: You will need more if-statements (Control), key pressing (Sensing), directional movement (Motion)
Item counter: - will be used to keep track of picked up items
- Create a variable for all sprites named "count"
- Go to the stage background:
- Reset the count variable to 0 when the game starts (green flag clicked)
- Use a forever loop after resetting the variable
- Add an if block to check if the count variable is ever equal to 10, then broadcast a message like "all collected"
- Go to the player sprite:
- When the player receives "all collected", then
- say "You win!"
- stop everything in the game (Hint: check the Control blocks)
Collecting Items:
- Import a new image for the items that the player will collect
- When the game starts, tell the item to go to a random location (use the goto and random # block for x and y)
- Use a forever loop to repeatedly do the following:
- Check if the item touches the player sprite, then:
- it should disappear (hide)
- broadcast a message to the player sprite to say something like "yum!"
- increase the item count by 1
- Check if the item touches the player sprite, then:
Dangerous Items:
- Import a new image for the dangerous items that the player will avoid
- When the game starts, tell the item to go to a random location (use the goto and random # block for x and y)
- Use a forever loop to repeatedly do the following:
- Check if the item touches the player sprite, then:
- it should disappear (hide)
- say "game over"
- stop everything in the game
- Check if the item touches the player sprite, then:
Bonus Features:
- Sounds - play a sound when:
- you collect an item
- collide with a danger and lose
- win
- Moving items and dangers (make some of the items and dangers move and bounce around the screen)
- Countdown timer - a time variable that starts at 10 (or another number you see fit)
- When the game starts, the time variable decreases by 1 every second
- If the time variable hits 0 and the item count is still less than the 5, then the player should lose ("Game Over" appears)
- Items that give the player more time
- Screenwrapping - when the hits the edge of the screen, it appears on the other side
- Wall collisions - prevent the player from going off the screen
- Health bar or Hit Points
- Multi-directional sprite images
- Explosion image when player sprite collides with a danger
- Change item count label to a point collection label
- Different items (worth different values)
- Increasing difficulty levels (more dangers)