Day Three - Enemy Movement


Note:

Today was another short day. I have a large project coming up at work that will be eating up some of my time so weekdays will probably be shorter then weekends for the foreseeable future.

Goal:

There were several goals for today

  •  Enemies should spawn in the room with the player and do not spawn on the player (this is still an issue while the player is moving)
  •  Enemies move and turn around when they reach a wall (they should also turn around at the end of a platform but I did not test this)
  • Fix some earlier mistakes
    •  Player was hard coded into the main room
    •  Player would collide with weapon
    •  Ladders existed but were not visible

Next Up:

  • Enemies chase the player
  • Enemies climb up/down ladders
  • Enemies will attempt to collect dropped currency

Details:

Room Definitions

A room is not just a box that stuff is in. The room now has a Area2d child that allows the room to detect when the player is in the room and then it can spawn enemies. This Area also defines the space the enemies are able to spawn in, which keeps enemies from spawning outside the room and it allows us to limit the number of enemies spawned in the room.

Enemy movement

Now that the enemies only spawn in the room we are able to do floor and wall detection. The enemies will spawn in either facing left or right and will move in that direction until they run into a wall then they will turn around, the enemies have a little face to indicate this. For platform detection the current thought process is, we have a collider on the bottom of the enemy that detects the floor when it no longer detects the floor it will turn around... this has not been tested and will probably need adjustment. Enemies do not interact with each other only the player and the environment.



Bug Fixes

Instancing Player

Not really a bug but something that was getting annoying now that I have learned how godot does prefabs: The player was hard coded in the main scene. I have now moved the player to its own scene that is instanced into the main scene. This will allow me to start creating room scenes and allow the player to be able to move between rooms without having to figure out that crazy.

Player collides with weapon

While working on some stuff yesterday I learned how collision layers and masking work. This allowed me to change up how the weapon worked and now the weapon will not collide with the player. It was hard to notice but if you were moving just right and you activated the weapon it would push the PC back slightly... I was pushed into mobs a few times "Dumb ways to die!"

Ladders!

More me being lazy then a bug.

On day 1 I created a ladder area got it all setup so the player could climb the ladder but there was no way to tell where the ladder was... it was invisible. I fixed that today. Now the ladders are visible, usable and purple!

These are currently not instances and neither are the platforms or rooms... this is a problem for future Fordorth.


For now this is non-Tardis owning Fordorth calling it a day... See you again tomorrow (assuming the hurricane does not kill my power!)

Files

boarding-school-from-hell-windows-beta.zip 127 MB
Version 3 13 hours ago

Get Boarding School From Hell

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.