the space ship need to get score 100 to win the game,the space ship can take the red heart for healing
Arrows-> Move the spaceShip
left click on mouse-> spaceship shoot laser
- first do get clone for the code:https://github.com/CourseGamedeveloper/Collect-Avoid-NewSpaceShip.git
- open the code in unity
- open the Scene Game in the prject and click on buttom play
- another opation to play the game in link below
- PlayerController:
This class manages the player's movement, health, and actions:
Responsibilities:
Handles player movement using Unity's InputSystem. Tracks the player's health and allows healing or taking damage. Fires lasers upon user input (mouse click). Interacts with UI to update the health bar dynamically.
- UIManager:
The class responsible for managing the user interface elements:
Responsibilities:
Displays the player's current score and updates it dynamically. Manages and updates the health bar. Listens for health and score changes using events.
- Constants:
Defines global constants used across the project:
Responsibilities:
Holds player movement speed and laser speed values. Simplifies adjusting gameplay parameters from one location.
- Enemybase:
Manages enemy interactions and behavior:
Responsibilities:
Handles collisions with the player or player's laser. Reduces player health upon collision and destroys itself upon interaction. Updates the player's score when destroyed by a laser.
- SpwanManager:
Controls the spawning of enemies:
Responsibilities:
Periodically spawns enemies at defined intervals. Limits the maximum number of enemies in the scene. Resets spawn timers after each spawn cycle.
- GameManager:
Handles the overall game logic and transitions:
Responsibilities:
Tracks player progress and checks for win or game-over conditions. Switches scenes based on game events like reaching a target score or health depletion.
- CollectibleItem
Manages collectible items like health power-ups:
Responsibilities:
Detects collisions with the player and applies healing effects. Destroys itself upon collection.
- Laser:
Defines the behavior of lasers fired by the player:
Responsibilities:
Moves the laser upward at a predefined speed. Deactivates itself upon leaving the screen boundaries.
- PlayerSpawner:
This class, PlayerSpawner, spawns a player character at a random position within a specified range when a new player joins the game, ensuring the local player spawns only once using Fusion's PlayerRef.
Link to the game:https://ibrahem-hurani.itch.io/spaceship-multiplayer
