Play the game on Itch.io: Prefabs Trigger
Welcome to my improved version of the Space Shooter Game! 🛸 This README outlines the modifications I made to enhance the gameplay experience and add exciting new mechanics. Let’s dive into the features I implemented! 🌟
-
🔫 Multiple Weapons with Key Combos
- I added different weapons for the player, each with unique characteristics:
- Lasers of varying sizes.
- Different speeds.
- Special firing modes (e.g., triple-shot).
- Key Combination System:
- Specific key combos activate each weapon.
- Typing
azfires a larger laser,tyfires a faster laser, andqwertriggers a triple-shot. - Combos are configurable through the Inspector, making it easy to adjust weapon behaviors without changing the code.
- This system adds depth and variety to the gameplay. 🎯
Key Example Code:
if (currentInput.EndsWith(comboForLargeLaser)) { ActivateWeapon(comboForLargeLaser); } else if (currentInput.EndsWith(comboForFastLaser)) { ActivateWeapon(comboForFastLaser); } else if (currentInput.EndsWith(comboForTripleShot)) { ActivateWeapon(comboForTripleShot); }
- I added different weapons for the player, each with unique characteristics:
-
🔥 Aggression Mode
- I introduced an Aggression Mode to increase the challenge:
- When activated, enemies spawn more frequently, adding intensity.
- How it works:
- Spawner behavior adjusts dynamically to the aggression state.
- Players must adapt their strategies to survive under pressure.
- This mode adds excitement and pushes players to strategize. 🧠⚡
Aggression Mode Code Example:
private void TriggerAggression() { SetAggressionMode(true); aggressionTimer = aggressionDuration; shotCount = 0; currentScore = 0; } private void SetAggressionMode(bool isAggressive) { OnAggressionModeChanged?.Invoke(isAggressive); }
- I introduced an Aggression Mode to increase the challenge:
-
🛑 Restricted Spacebar Shooting
- To balance the gameplay and encourage the use of key combos, I implemented spacebar rate limiting:
- The player can only fire 3 shots per second using the spacebar.
- Once the limit is reached, the spacebar enters a cooldown for 1 second.
- This ensures thoughtful engagement with the combo system rather than relying on rapid spacebar tapping. 🕹️
Spacebar Limiting Code Example:
if (shotsFired < maxShotsPerSecond && shotCooldownTimer <= 0) { FireLaser(); shotsFired++; if (shotsFired >= maxShotsPerSecond) { shotCooldownTimer = 1f; } }
- To balance the gameplay and encourage the use of key combos, I implemented spacebar rate limiting:
My goals were to:
- Add depth and variety to the game with the key combination system.
- Increase gameplay challenge with the aggression mode.
- Prevent overuse of rapid spacebar firing and encourage strategic use of different weapons.
-
Run the Game:
- Clone the repository and open the project in Unity.
- Play the game and test the new mechanics.
-
Key Combination System:
- Type
az,ty, orqwerduring gameplay to test the different weapon effects. - Observe how lasers change in size, speed, or firing mode.
- Type
-
Aggression Mode:
- Trigger aggression mode and observe the increased enemy spawn rate.
-
Spacebar Limiting:
- Rapidly tap the spacebar and confirm:
- A maximum of 3 shots per second.
- A 1-second cooldown after reaching the limit.
- Rapidly tap the spacebar and confirm:
- Unity Engine: Core development platform.
- Git: Version control for efficient management and tracking.
- C# Programming: Implemented game mechanics and optimizations.