Skip to content

Latest commit

 

History

History
44 lines (36 loc) · 2.96 KB

README.md

File metadata and controls

44 lines (36 loc) · 2.96 KB

Monster Dodger Game

Overview

Monster Dodger is a simple 2D game where the player's objective is to dodge monsters that spawn from both sides of the screen by jumping over them. The game features basic player controls for movement and jumping, monster spawning from random sides, and a scoring system based on the player's survival time.


1 3

Gameplay

  • Controls: The player can control the character using the arrow keys (or A and D keys) to move left or right and the spacebar to jump.
  • Objective: Dodge the monsters by jumping over them. The longer the player survives, the higher the score.

1 1


1 2

Project Structure

The project is structured as follows:

Scripts

  • CameraFollow.cs: Controls the camera movement to follow the player horizontally.
  • Collector.cs: Destroys objects that collide with a trigger area, used to remove monsters and the player when they go out of bounds.
  • GameManager.cs: Manages the game state, including player selection, scene loading, and singleton pattern implementation.
  • GameOverManager.cs: Manages the game over state, displaying text when the player loses.
  • Home_RestartUI.cs: Controls UI interactions for restarting the game or returning to the main menu to select different character.
  • MainMenu.cs: Handles interactions with the main menu, including starting the game.
  • Monster.cs: Defines the behavior of monsters, including their movement speed.
  • MonsterSpawner.cs: Spawns monsters at random intervals from both sides of the screen.
  • Player.cs: Implements player movement, jumping, collision detection, and interaction with monsters.

Prefabs

  • Player: Prefab for the player character.
  • Monster: Prefab for the monsters that spawn in the game.

Note:

  • I created this project by learning from freecodecamp, my additional features include scoring mechanism and a game over display.

How to Use

  • Clone the repository or download the .zip file
  • Ensure that Unity Engine and Visual Studio is present in the system.
  • Go to Scenes in Assets folder Click on MainMenu and press play to play the game.