- Full unity projects are difficult to push to github due to file size constraints, so this repository contains the C# scripts for the game objects in a simple pong game.
- When the game starts, press space to make the dino jump and avoid the cacti.
- If the dino hits one of the cacti, the game ends. The player is prompted to try again.
- Each cactus that the dino successfully evades grants 1 score.
- Once the cactus and cloud gameobjects leave the screen, they are destroyed to maintain memory.
- cactusScript.cs handles the movement and collision behavior of the cacti (the dino remains stationary throughout the game, only the cacti move toward it thus creating the illusion of movement).
- cloudScript.cs handles the movement of the cloud game objects above the dino. These do not have any significant gameplay involvement.
- spawnerScript.cs creates cactus gameobjects in groups of one or two based on a set timer (the cacti may be spaced apart randomly within a given range).
- cloudSpawner.cs, similarly to spawnerScript, spawns the clouds based on a set timer and randomly spaced apart within a given range.
- dinoScript.cs handles the jumping behavior of the dino.
- logicScript.cs handles the rules of the game and the scoreboard management. It will also prompt the player to reset the game upon collision with a cactus.
- midScript.cs handles the trigger that is placed in the middle of each cactus or between a joined pair of cacti. This trigger is used to track when the dino jumps over a cactus and updates the scoreboard accordingly.
-
When the game is first started, it will look something like this.
-
When the player scores, the scoreboard will update accordingly. When the dino collides with a cactus, the following screen will appear.
- Nicholas Golparvar