top of page
Player Character handles input for movement and shooting, but also other calls like game over so we can show the right UI via blueprint.
The code creates a few projectiles in the beginning and adds them to a list, so the player can use the same projectiles instead of spawning new ones.
Enemy Character controlls the movement, shoots down projectiles, checks for walls wether that be to change direction or to call game over.
The manager spawns in and keeps track of all active enemies, and spawns in projectiles for them to use. It holds the counter for when the enemies should shoot and a reference to the player character.
The projectile is persisten throughout the game. They are spawned in by corresponding character but are never destroyed, only rendered invisible and have their collision turned off. They are then reactivated again when being shot.
On hit, it checks what type of enemy to destroy so i.e. an enemy doesn't kill another enemy.
bottom of page