13/04/19: Day Three


Today's goals:

  • Enemy AI (Rotation & Player Detection)
  • Camera Movement System (Between Rooms)
  • Secret Rooms/Items

Today's extended goals:

  • Enemy Sprite
  • Level Design (First Three Levels)
  • Health System

Once my PC, Unity, Aseprite and Atom had all loaded up it was time to get to work. The first of today's tasks was to develop the AI system for one of the enemy types. Since I am adding in some stealth elements, my first enemy is based on a detection system. Programming this was fairly straight forward, however, I encountered an issue with checking the Z axis value and fliping the direction of rotation when it reaches a certain point. Because of this, I settled on using the Unity animation tool to create the rotation; which the raycast thankfully followed. The final step of this mechanic for now was to allow for player detection within a certain distance. This was acheived using  "hit.distance" and checking if it was less than a value; I settled on using two for this testing purpose. Seen below is how the enemy is currently represented without it's art work.

 

Another task I completed was fixed a collider issue. This issue only occured when the player would try to walk under a one way platform. To resolve this, I had to make the collider thinner and place it higher up on the sprite.

After grabbing some lunch I decided to start working on the rest of the first level; which also includes adding a tutorial version of a hidden room. There where many parts to the phase since I had to design the level, create it using tiles, add the relevent colliders and platform effectors and also code in the camera movement system. I experimented with using the "MoveTowards", "Lerp" and "Slerp" functions and found that "MoveTowards" provided the best result for moving the camera.

The video above also demonstrates one of the secret rooms. This one will have a sign sprite infront of it; since it is designed to be a tutorial hidden room. However, future hidden rooms will not have the sign and will contain treasure instead of coins.

As my day of working came to an end, I finished up the core of exiting the level. I did this using "UnityEngine.SceneManagement" which allows me to change the scene within the game. To show the player where they can exit the level; and also where they came from (shown when you load up a level); I created  4 tiles to show a rocky hole. Seen below is the image.


My final ajustment was to the UI layout. I added in a black bar; to simulate what you see in games such as Shovel Knight. This also allows for seeing the UI to be easier as the level doesn't obstruct the look of the text. I also added a panel and upped the opacity; which is used to allow for a darker effect when playing. I will possibly include adjusting this value from the settings menu; which allows it to work as a brightness setting. Seen below is the UI at it's current stage.


Achieved today;

  • Enemy AI (Rotation & Player Detection)
  • One Way Platform (Collider Issue)
  • Camera Movement System (Between Rooms)
  • Hidden Rooms
  • Level Exit (System and Graphic)
  • UI (Darkness & Black Bar)

Get Cave Dweller's

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.