Bomber Man Remake

The Bomber Man Remake was a final assignment project for an AI class done by myself and Cory (a fellow programmer) in two weeks. We had many tasks we had to cover. I was in charge of the Map Editor as well as AI steering, state behavior, and an A* Pathing Algorithm.
The project was a bit tricky as we made much of it from scratch specifically the editor and collision system.
Editor Snippets

Lines 70-73: Must get the key and mouse events every step with allegro to use for inputs.
​
Lines 75-80: Set the value at the grid position which will change to the designated sprite when drawn.
​
Lines 83-86: Cycle through sprites set in loader.
​
Lines 89-94: Cycle through levels loaded through loader.
​
Lines 97-98: Save the current level.
Loader Snippet

Lines 38-39: Separates editor and level assets by setting the count assets to 0.
​
Line 57: Gets the type of the asset/ differentiates between level and editor assets.
​
Lines 42-44: Gets sprite info, the string for the path, the collision type of the object, and the name.
​
Line 45: Loads the sprite into the game.
​
Line 46: Sets the use of the asset in the editor.
​
Lines 47-48: increments the asset id that will be added to the editor list of sprites. Then increments all assets to be used.
​
Lines 52-55: Loads Level info to be used in editor and game.
A* Snippets

Line 39: Gets the player position to be used for dist calculation.
​
Line 41: Checks distance to player, or if the path is greater than 0.
​
Lines 44-48: Switches to Seek Behavior when player is close enough.
​
Lines 50-54: Get path if there is no created path.
​
Line 56: Set the direction the AI should move in.
​
Line 58: Movement behavior calculation.
Direction Snippet

Lines 81-83: Get AI position and the grid, then use both to get the AI's position on the grid.
​
Line 87: Get next node in list if there is no current node or the current node is arrived at
​
Line 91: Get the direction vector to the next node.
​
Line 92: Debug for the direction.
​
​