This project represents a Unity game of 2 spaceships that co-opporate to destroy their ememies and survive.
There are currently two types of confrontations, enemies' spaceships and meteors.
Meteros - come from unexpected directions and relatively slow.
Enemies' Spaceships - faster than the meteors, which makes them more dangerous but more rewarding.
code: My approach for enabling this behavior to be generic as possible, the enemy's objects will contain the component EnemyDestroyOnTrigger2D that will provide each enemy object unique score attached to him, used by ScoreAdder. To keep the speed - score ratio, the enemy's velocity will be calculated relatively to the enemy score in TimedSpawnerRandom, also providing SerializeField for list of enemies, to make it easier to add different types of enemies with different score.
Both players contribute to the shared score.
In any good fight, partnership is the key to victory!!
This game features two types of spaceship heros to choose from, as each one of them has their own unique ability.
By hovering over his ally, he has the ability to cast shield on his ally for 5 seconds.
ShieldThePlayer is a component in the support object, which Triggered on collison with the other player, recieving two other components, ShieldActivation for setting shield state, and the CircleAnimation for displaying the shield on the player.
The support player have indication time animation for the ability cooldown, switching on colors red/green based on the cooldown state CircleAnim .
Skill cooldown: 20 seconds.
By pressing L, the damage dealer player will activate his special offence ability, each fire press he will shoot 3 lasers in a fan shape for 5 seconds.
UltimateLaser is a component that recieves duration, IndicationTimer and input button for casting the special ability.
Activating the special ability is handled in LaserShooter.
Skill cooldown: 20 seconds.
The controls for the game are as follows:
Support Player
- W: Move the Player upwards
- A: Move the Player to the left
- S: Move the Player downwards
- D: Move the Player to the right
Damage Player
- Arrow UP: Move the Player upwards
- Arrow LEFT: Move the Player to the left
- Arrow DOWN: Move the Player downwards
- Arrow Right: Move the Player to the right
- L: Enable Ability
