Monday, May 8, 2023

MA Games Design 2022-2023: Dream Roamer: Enemy AI


 Each of the enemies that appear in the game will function differently to give the gameplay experience much needed variety. As such, theya re all coded differently, their functions dictated usually to where the player is positioned.

The first enemy created for this game is the Gunk, who worls similarly to a Goomba from various Mario games, walking left and right, not being a significant threat. 


 

This code means that the Gunk will cause damage to the player if you come into contact with it.


This is the code used for moving the Gunk left and right in a simple pattern.

The next enemies I have added are Encorachers, who are more aggressive than a Gunk. Their main gimmick is that when the player gets within a certain distance to them, the Encroacher will approach at a faster rate.



This code dictates the Encroacher to move close when the player is 7 tiles or less distance.

For each of the last areas in each level, I have implemented a trigger that will move the player into the boss encounter before it will appear, before the boss will show up to initiate the fight. After dealing enough damage to the boss, they will disappear, and the player can move on to the end of the stage without incident.




This is the code used for the standard functions of the boss enemies in Dream Roamer.


No comments:

Post a Comment

XB4406: MA Games Design: This Way Up!: Extra Background Card Designs

 My next step with This Way Up! was to implement different card backgrounds, based on the importance and severity of some of the objects in ...