Challenge 3 - Balloons, Bombs, & Booleans

Tutorial

·

Beginner

·

+10XP

·

60 mins

·

(970)

Unity Technologies

Challenge 3 - Balloons, Bombs, & Booleans

Challenge Overview:

Apply your knowledge of physics, scrolling backgrounds, and special effects to a balloon floating through town, picking up tokens while avoiding explosives. You will have to do a lot of troubleshooting in this project because it is riddled with errors.

Challenge Outcome:

  • The balloon floats upwards as the player holds spacebar
  • The background seamlessly repeats, simulating the balloon’s movement
  • Bombs and Money tokens are spawned randomly on a timer
  • When you collide with the Money, there’s a particle and sound effect
  • When you collide with the Bomb, there’s an explosion and the background stops

Languages available:

1. Overview


  • Open your Prototype 3 project


  • In the Project Window > Assets > Challenge 3 > Instructions folder, use the Challenge 3 - Outcome video as a guide to complete the challenge

2. Warning

When you import the challenge into your project, it is supposed to have bugs.


The purpose of the challenge is for you to fix those bugs, which are listed below. There are also hints at the bottom of the page to help you if you get stuck.


If you cannot fix the bugs and wish to delete the challenge files from your project, in the Project window, right-click on Assets > Challenge 3 and select Delete.


Good luck!


3. The player can’t control the balloon

  • The balloon should float up as the player presses spacebar

4. The background only moves when the game is over

  • The background should move at start, then stop when the game is over

5. No objects are being spawned

  • Make bombs or money objects spawn every few seconds

6. Fireworks appear to the side of the balloon

  • Make the fireworks display at the balloon’s position

7. The background is not repeating properly

  • Make the background repeat seamlessly

8. Bonus: The balloon can float way too high

  • Prevent the player from floating their balloon too high

9. Bonus: The balloon can drop below the ground

  • Make the balloon appear to bounce off of the ground, preventing it from leaving the bottom of the screen. There should be a sound effect when this happens, too!

Optional Step

10. Hints

  • The balloon should float up as the player presses spacebar
    Hint - There is a “NullReferenceExcepton” error on the player’s rigidBody variable - it has to be assigned in Start() using the GetComponent<> method

  • The background should move at start, then stop when the game is over
    Hint - In MoveLeftX.cs, the objects should only Translate to the left if the game is NOT over

  • Make bombs or money objects spawn every few seconds
    Hint - There is an error message saying, “Trying to Invoke method: SpawnManagerX.PrawnsObject couldn't be called” - spelling matters

  • Make the fireworks display at the balloon’s position
    Hint - The fireworks particle is a child object of the Player - but its location still has to be set at the same location

  • Make the background repeat seamlessly
    Hint - The repeatWidth variable should be half of the background’s width, not half of its height

  • Bonus - Prevent the player from floating their balloon too high
    Hint - Add a boolean to check if the balloon isLowEnough, then only allow the player to add upwards force if that boolean is true

  • Bonus - Make the balloon appear to bounce off of the ground, preventing it from leaving the bottom of the screen. There should be a sound effect when this happens, too!
    Hint - Figure out a way to test if the balloon collides with the ground object, then add an impulse force upward if it does

Complete this tutorial