- Click this link to remix the template: Remix Template
Remix the Template
Set Up the Title Screen
Welcome players to Delivery Hero by displaying an opening title screen when the project runs.
- Snap a set background to block under the when run block.
- Snap a show title screen block below the background block.
- Set the title to "Delivery hero".
- Set the subtitle to "Press space to continue".
Start the Game on Space Key
When the player presses space, start the gameplay if the game is not already running.
- Add a when space pressed event block.
- Add an if condition block checking if gameStarted ≠ true.
- Place a reset timer block inside the if block.
- Add a hide title screen block.
- Add a hide variable cash block.
- Add a hide variable orders block.
- Add a set background to block.
- Add the createRider function block.
- Add the createMap function block.
- Add the createHaze function block.
- Set countdown to 12.
- Add a show variable countdown and place it at the top left corner.
- Set gameStarted to true.
- Set cash to 0.
Create Haze Effect
Set up background haze sprites that flutter and wander across the screen.
- Open or define the createHaze function block.
- Draw your own haze sprite
- Add a make 10 new haze sprites block inside createHaze.
- Add a sprite begins fluttering behavior block for the haze sprite.
- Add a sprite begins wandering behavior block for the haze sprite.
Create the Map and First Cash
Generate the city layout with building obstacles and place the first cash pickup.
- Open or define the createMap function block.
- Add a make sprites using grid block inside createMap and place the buildings into your map.
- Add a make new cash sprite at a good location.
- Add a set cash size to 30 block.
Count Down Timer
Manage the game countdown clock each second while the game is active.
- Add an at 1 seconds recurring event block.
- Add an if condition checking if gameStarted = true.
- Add a reset timer block inside the condition.
- Add a change countdown by -1 block.
- Add an if condition checking if countdown = 0.
- Add a play sound block with 'Alerts: vibrant_game_carton_start_game_2_long'.
- Add a remove all sprites block.
- Add a set background to block.
- Add a show title screen block with title 'Delivery completed' and subtitle 'Press space to try again.'.
- Call the showEndingCash function block.
- Set gameStarted to false.
Handle Cash Collection
Reward the player with cash, orders, extra time, and speech feedback when picking up cash.
- Add a while rider touches cash event block.
- Add a play sound block with 'Bell: vibrant_cash_register_open_positive_game_open'.
- Add an object cash jump to random location block.
- Add a change countdown by random integer from 2 to 6 block.
- Add a change cash by random integer from 10 to 100 block.
- Add a change orders by 1 block.
- Add a subject rider say 'cash: ' cash for 4 seconds block.
Respawn Cash Away from Buildings
Ensure cash jumps to a new location if it spawns on top of a building.
- Add a while cash touches building event block.
- Add a subject cash jump to random location block inside the event.
Handle Rider Crash
Detect crashes against buildings and display the game over screen.
- Add a when rider touches building event block.
- Add a play sound block with 'Alerts: playful_quirky_negative_game_cue_2'.
- Add a remove all sprites block.
- Add a set background to block.
- Add a show title screen block with title 'RIP' and subtitle 'Press space to try again.'.
- Call the showEndingCash function block.
- Set gameStarted to false.
🎉 Congratulations!
Next challenge!
- Add a high score system that tracks the most cash and orders collected.
- Add different types of obstacles or moving traffic vehicles for the rider to dodge.
- Create power-ups that temporarily freeze the timer or double the cash earned.