Enemies and Interactions
Devlog Three: Enemies and Interactions
This is the third weekly devlog, and its focus was on the enemies and player interactions. For A Slime's Labyrinth this meant the programming of the enemies, as well as player health and score.
Enemies:
As stated in previous Devlogs, there are three enemies within the game: Rookie, Apprentice, and Master. For interactions with the enemies, the player character three radius circles added on, in order to detect when the player was near for changes in behaviour. When the player is far from the enemy, it will wander around. This is done by having a script select a point far away, then making the character move towards it for a range of time. When the player was near, there are two different interactions that can take place depending on the type.
Rookies:
The Rookie radius is the largest, meaning that the player doesn't need to be as close in order to activate the conditions. When near, the Rookie will flee away in the exact opposite direction to the player.
Apprentices and Masters:
The Master has the smallest radius, and the Apprentice has the middle one. When inside the circle, the enemy's ai will use the players current direction of movement, in order to predict a set time frame ahead and chase down the player.
Destroying Rookies:
To destroy a Rookie, the player must shoot them three times. Player shooting has already been talked about in devlog one, but in order for the Rookie to be destroyed I wrote a script that detects when a slime ball makes contact with the Rookie, then each time subtract one point of a set health. When that health reaches zero, the Rookie game object gets destroyed.
To tell the player that they successfully hit the enemy I also implemented an animation of the Rookie flashing red. This is activated by the same script as the health setting a parameter of "Hurt" to true when they are shot.
Player Health and Score:
For the player health, I used a script that created a set health that would be subtracted from when a collision is made with a Master or Apprentice and update a text GUI label I created in the game scene. This script also would open a death screen when the health reached zero.
For player score, I wrote a script that allows me to say how many Rookies are in the scene and end the scene when the score reached this number. I then added a different script onto the Rookies that would add one to the player score when its game object got destroyed. The display for this was done the same way as the health, updated through the first score script.
Extra Title Screens:
This week as an extra, I also updated the Help screen, as well as change the settings screen to a Credits screen.
Previous Week Feedback and Fixes:
"The Z rotation for the player on Level 2 is bugged." -- This was fixed by freezing the Z rotation for the player on this level.
"The enemy sometimes gets stuck in the wall." -- I adjusted the colliders for the enemies in hopes that it helps, but have been unable to fully confirm this fix, as I have never seen it bug myself.
Files
A Slime’s Labyrinth
Status | In development |
Author | DaniLove25 |
Genre | Action |
More posts
- Documentation and User GuideMay 31, 2024
- Polish and TestingMay 26, 2024
- Visual Graphics and Bug FixesMay 19, 2024
- Level BlockingMay 05, 2024
- Player Movement and ShootingApr 25, 2024
- Game ConceptApr 19, 2024
Leave a comment
Log in with itch.io to leave a comment.