Week 10 : Enemies and Interactions


Enemies & Interactions

In this week, I have implement enemies in the game world to be defeated. As the first mission in Escape Mania is to kill enemy as many as possible, spawning enemies are crucial in this game.  Another thing is interactions with objects in the game. When plenty of enemies have been killed, a treasure box will be spawned in random places each time. These treasure boxes are crucial for the next mission as it gives tools to help the player to complete the game.
Enemies
  • What is it and how it works?
    First of all, the  enemies here in the game world are similar to ghosts. Therefore, they can move to all direction without colliding with any objects or walls inside the game world. Now I will explain how the enemies works. So right after 10 seconds the player appeared in the game world, the enemies will be spawned in 5 random places. Each spawner will spawn an enemy every 10 seconds during the game. Every time an enemy is spawned, there will be animation of the enemy appearing like a ghost. After then, the moving animation is applied to each of the enemy while moving around.


  • How to kill the enemy?
    To kill the enemy, the player will be using the gun to shoot the enemy. However, the each enemy has a health bar and it consists of 5 lives. When the player shoots toward the enemy and the bullets hit/collide with the enemy, its live will be decreased which can be seen by the health slider move to left. If the enemy has only 1 live left, the health slider will turn form green to red. This is implemented to let the player know when the enemy will die. When the enemy dies, an animation of it disappearing will be played following the enemy being destroyed (gone from the game world).


  • How it attacks the player?
    Not only the player can kill the enemy, but the enemy can do the same as well. The enemy attacks the player by moving towards the player when it is near the player. Here I make a radius to the player so that when the enemies collided with the player’s radius, it will have an effect of dragging the enemies toward himself. Same as the enemy, the player also has health bar which can be seen as hearts in the top-left of the game. The player has 3 lives but each live has 5 sub-lives. Every time the enemy collided with the player, it will decrease the sub-live of the player which is described by the amount of blood inside the heart decreased. When it reached to empty (5 times collided with enemies), the empty heart will be gone. This means that the player has only 2 lives left.


  • However, when the enemy is not inside the radius anymore, it will either go to other direction or move away from the player.

Chest
  • How it appears?
  • After some enemies have died, a chest will appear in random places. Here I have set 5 random places in the game world to spawn a chest.

  • How it can be opened?
  • When player goes near to the chest and press 'Space' key, the chest will be opened and an object inside will come up. The object inside the chest can be a key to access the underground room or it can be power up/tool to help the player to avoid being defeated easily.


Underground room 1 Character
  • The Monster
  • In this underground room, I have implemented a new character called the monster. Basically, this has pretty similar effect with the enemies in the Game World(main room) where the player will get his sub-live decreased when colliding with the monster. However, this monster can only move either up and down or left and right. And one thing that player has to know is that the monster cannot die. They will keep on moving and if the player collides with the same monster, the player will lose it sub-live again.


  • Coins
  • The coins here are need to be collected in order for the player to complete the mission in the underground room. When the player has collected all 20 coins, the player then can escape the underground room by finding exit stair. Also, I have given an animation for the coins so that it feels like the coin is turning using sprite sheet.


Underground room 2 Object
  • The red and green light
  • In this underground, the player will be playing the red light and green light game. Basically the player will have to move during the green light and stop during the red light. If the player moves during the red light, player's sub-live will be decreased. Here I have used light illustration to be used for letting the player know what is the current light. Also, I have used Unity's Point Light 2D to change the light to red when it's time to stop and normal light(white) when it's time to move.


Feedback

During KIT109’s tutorial in week 10, I have gotten feedback from my peers as they have test my game and play with the enemies and other new feature in the game. Here are their feedback:

 enemies are looking great, especially love the animations for them! for some reason, my health disappears after a while, and looking at your reply to Ethan, the player is supposed to teleport to the start after it collides with an enemy, but its not doing it

So basically it is correct that the player is supposed to teleport after it collides the enemy. So there are some error in my script so I have changed the index of an array so that when the index reach the last element in the array, the player will be teleported to the start position of the game. Anyway, thank you for giving me feedback:)

Hey Jastine, Games looking pretty polished right now. Small issue I noticed with some tighter corridors, this area in specific (see attached video) felt a bit tight to move through, that might just be me though.

I have fixed the collider in the some areas so that the player have more space to move now. I did it by changing the collider type of the blue thingy from Sprite to none Thanks for letting me know!

Improvement

An improvement that I have made in this step is that by adding  a new cinemachine cam when a player is colliding with the chest object and press the enter key to open it. When the chest is opened, the camera will zoom in following the player so that we can see what object inside the chest.

Credits

Files

BasicLevelBlocking_updated.zip 6.7 MB
Sep 19, 2021
EnemyInteraction.zip 6.8 MB
Sep 23, 2021

Get ESCAPE MANIA

Leave a comment

Log in with itch.io to leave a comment.