top of page

INFESTED NEBULA

Player Controls

For the player I created a finite state machine. For one of the states I made it update the player movement and shooting mechanics.

Player Movement

For how I did the shooting I first got the vector between the cursor position and the player position and then spawned a bullet based on that vector direction.

Aiming with Mouse

Shooting

Base Enemy AI

For the Enemy AI I also created a finite state machine. I created a state for Idle, attacking, and strafing.

For the attacking behavior I created a simple zombie like behavior that follows the player. When the enemy collides with the player the player takes damage.

​

When the enemies are not aggroed they will either be
idle or strafe up & down or
left & right.

Simple Zombie Behavior

Player Death

Strafing Left & Right

Strafing Up & Down

Menu/HUD

For the main menu, options, how to play, and credits I made different game states for each of them. I then created a behavior script for a button that can tell if you have hovered over it or if you have pressed it. I also added 2 types to the behavior, one for changing game states once clicked and one type for turning a feature on and off.

​

For the pause menu I had to do something else because if you went to a different game state during the level you would lose all your progress when you went back so I instead drew what would be in the game state over the pause menu and when you go back it will stop drawing and disable the buttons for that game state.

Main Menu

Pause Menu

For the HUD I made the health bars. I first layered the green and red bars and scaled them over the object. I then did some calculations to scale the green bar based on the object’s current health.

Health Bars

bottom of page