Enemy AI that makes the enemy pawn fly towards the player location if it is above the player. Else the default movement is used. The goal of the AI is to collide with the player to deal the defined collision damage.
BP_HealthComponent handles the logic for health system and health regen system.
The health system handles taking damage, changes the maximum health and checking if the character is dead.
The health regen system, regenerates the character’s health after not taking damage for a while.
BP_BaseEnemy is the generic enemy class. It serves as the base class for all enemy types and can be easily customized using the different property structures.
Adding a new enemy is as easy as creating a new rule in the EnemyType data table and specifying its properties.
BP_Player is the player of the game. It handles player input for movement, firing projectiles and activating nukes.
The player support movement using the built-in Unreal Engine physics of simple sweep movement.
It also allows for several skills using the different pickups like activating a shield and upgrading its weapon from single shot to double or even triple shot.
It has an ammo system for the normal weapon and nukes. The weapon ammo also has an unlimited option. The player has three fire modes:
The user can select different ships using the ship select menu in the main menu. These are defined in the PlayerShips DataTable.
Main Menu Game Mode
BP_MainMenuGameMode is the game mode and specifies the BP_MainMenuPlayerController as default controller. It is used as the game mode in the Main Menu and Mobile Main Menu maps.
Space Shooter 2D Game Instance
BP_SpaceShooter2DGameInstance is the game instance and handles the ship selection options and currently selected ship. It is used by the game modes, the selection in the main menu and the correct spawning in the Test maps.
Space Shooter 2D Game Mode
BP_SpaceShooter2DGameMode is the game mode and handles the current score, score multiplier, and game over actions. It is used as the game mode in the Test maps.
BP_SpaceShooter2DGameState is the game state and handles the saving and loading of the save game.
BP_SpaceShooter2DSaveGame is the save game and acts as a container for the save data (e.g. high score).
BP_BasePickup is the parent class of all the pickup types. It handles the activation of the pickup when hitting the player, after which is destroys itself.
BP_HealthPickup is a pickup that return a set amount of health to the player.
BP_NukePickup is a pickup that adds one nuke ammo to the player.
Score Multiplier Pickup
BP_ScoreMultiplierPickup is a pickup that activates a score multiplier for a limited amount.
BP_ShieldPickup is a pickup that activates the shield of the player.
Weapon Ammo Pickup
BP_WeaponAmmoPickup is a pickup that adds a set amount of weapon ammo to the player.
Weapon Upgrade Pickup
BP_WeaponUpgradePickup is a pickup that upgrades the weapon of the player.
Is responsible for creating and interacting with the Main Menu
Is responsible for creating and interacting with the HUD (Pause Menu and HUD changes).
BP_BaseProjectile is the parent class of the enemy and player projectile. It handles the initialization of direction and speed and checks if the target is damageable.
It also contains the homing logic which can be set using a target.
BP_EnemyProjectile is the projectile fired by enemies and only collides with the player. On collision is damages the player an amount specified by the public variable and destroys itself.
BP_PlayerProjectile is the projectile fired by the player and only collides with the enemies. On collision is damages the enemy an amount specified by the public variable and destroys itself.
BP_BaseSpawner is the parent class of all spawner types. It can be enabled/disabled (on/off) and activated/deactivated (spawning/sleeping).
It contains methods for spawning an actor, spawning a specific enemy (type) and filter a list of enemies on type.
Max Enemies Spawner
BP_MaxEnemiesSpawner is a spawner that only spawns a specific type of enemy when the amount of this type of enemy in the level is below a threshold. For example, it only spawns a Meteor enemy when there are less than two Meteor enemies in the level.
BP_PickupSpawner is the spawner for all pickups and uses a list of pickup spawnees. Each spawnee defines the type of pickup, its spawns per minute and the scale of the pickup.
BP_WaveSpawner is a spawner that spawns waves of enemies randomly chosen from the possible spawnees. It defines several customizable delays, for example delay between enemy spawns and delay between waves.
All user interfaces support mobile and gamepad input. Whether to highlight the selected button can be toggled using the ShouldHighlightFocusedButton variable.
The BP_HUD is the in-game user interface and shows the player the current health, ammo, score, score multiplier and amount of nuke ammo.
It also defines the game over screen with the high score, current score, option to reset the high score and option to return to menu.
The pause menu user interface is also integrated in the HUD and allows the player to continue the game or return to the main menu.
When on a Mobile platform, the HUD dynamically switches to a more centered version with bigger button for touch input and shows the virtual joystick and buttons (fire, nuke and pause).
BP_MainMenu is the main menu user interface and allows the player to start the game, contains the settings like help text and ship selection and quit the game.