Controls: [SPACE] to jump / evade the incoming cone

Purpose: Animations, particle effects, and sounds

  • Create a background that loops seamlessly, with endless obstacles, but stops when the player dies
  • Player should feature a jumping animation and a death animation
  • When running, dirt particles are emitted from the player
  • When dying, smoke particles are emitted from the player
  • Music is heard throughout the game

Methodology:

  • C# Scripting in Visual Studio:
    • To get the character to jump, use AddForce on the rigid body. ForceMode.Impulse will send force immediately. Tweak using Physics.gravity, which will help you adjust Unity's gravity.
    • Use an If Statement to see when the background is halfway from its starting position, then have it go back to the starting position
    • Use a boolean to determine whether the game is over or not. Include this boolean in the If statements (using a && operator or == operators) to prevent the player to jump when game is over, to stop the background from moving, and to stop the cones from spawning
    • To animate, reference the Animator class, get the component, and call on the specific state you want to activate, like jump or death
    • To add particles, reference the Particle System class, and use its Play and Stop functions to determine when the system should be activated / deactivated. Ex: If the player is running, dirt comes off of their feet, but not when they are in the air.
    • For the explosion and jumping sound, reference the Audio Clip class as well as the Audio Source class, get the Audio Source component in start, then use your Audio Source variable and the Play One Shot ability to play the appropriate clip.
  • Unity:
    • Adjust the parameters in the Animator to use different states, like selecting the starting state, and the speed of the states.
    • To get sound, add an Audio Source component to the player for the jumping / exploding sound. Add an Audio Source component to the main camera to get music throughout the game

Plans for Future improvement:

  • Create a UI system that features a stopwatch. The timer will stop when the player hits an obstacle. Ideally the player's best time is saved for that session.
  • Create objects for the player to collect and stack up on points.
  • Obstacles should variate in size and at random distances to make them more unpredictable


Leave a comment

Log in with itch.io to leave a comment.