Skip to content

TwoBitCode/prefabs-triggers-vivi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Enhanced Space Shooter Game 🚀

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! 🌟


🎮 What I Did

  1. 🔫 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 az fires a larger laser, ty fires a faster laser, and qwer triggers 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);
    }
  2. 🔥 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);
    }
  3. 🛑 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;
        }
    }

🎉 Why I Made These Changes

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.

🧪 How to Test

  1. Run the Game:

    • Clone the repository and open the project in Unity.
    • Play the game and test the new mechanics.
  2. Key Combination System:

    • Type az, ty, or qwer during gameplay to test the different weapon effects.
    • Observe how lasers change in size, speed, or firing mode.
  3. Aggression Mode:

    • Trigger aggression mode and observe the increased enemy spawn rate.
  4. Spacebar Limiting:

    • Rapidly tap the spacebar and confirm:
      • A maximum of 3 shots per second.
      • A 1-second cooldown after reaching the limit.

🛠️ Tools and Techniques Used

  • Unity Engine: Core development platform.
  • Git: Version control for efficient management and tracking.
  • C# Programming: Implemented game mechanics and optimizations.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •