top of page

For this game, all assets had to be drawn in pixel art and all code had to be drawn by myself. The game was to be an action platformer with at least 3 enemies and a final boss, many interactable items and actions for the player include: jumping, shooting, walking, dashing and warping. 

Screenshot 2024-04-17 142647.png
Screenshot 2024-04-17 142630.png
Screenshot 2024-04-17 142657.png

Once this challenge was taken care off all I had to do was create a patrol and attack phases.

Pseudocode:

If line of sight hits a player, enemy immediately becomes aware of the player.

If player is still within line of sight, enemy shoots gun.

If player is not in line of sight,

enemy will walk in the directions of the player until player is within line of sight

If player has not been in line of sight for 2.5 seconds, enemy forgets about the player and begins to patrol at random locations.

The biggest challenge faced when creating this game was the enemy AI. In this game I wanted to have a shooter enemy but deciding the trigger for when the enemy should shoot was the hardest part. Using a distance check would not work as the gunman would constantly be shooting through walls so the best action was to have a line of sight for the enemy. 

However, there was no built in line of sight within the game engine so I had to create an invisible dot that shot from the gunman in a straight line towards the player. 

This took around three days for me too figure out to make it work as whenever i tried to make it go fast it would go straight through walls and hit the player. If i slowed down the speed the enemy would take too long to read that a player was there.

After doing some testing with stencyl's game engine, i found out that an object that had collisions and physics on could detect tiles faster than the game could process the dot's speed since collision physics take priority over all other codes.

Taking advantage of this, I made a dot with 0.01 mass with physics and since the dot shot at an incredibly high speed, there was no need to worry gravity affecting the trajectory of the dot. 

The downsides of this is that the dot pushes the player and have a small chance of affecting movement. However, the affects are incredibly minute and unnoticeable with barely a 0.1% affect on movement

bottom of page