Sniper teleportation

 Author: Pedro Polanco III

    When I was creating the sniper class for our game, I was trying to make him teleport between the corners of the map and he would instead be teleporting outside of the map. This would obviously cause issues if it's not fixed because the player would not be able to kill the enemy due to him being outside of the map making it so they cannot progress.

    When I was debugging the code, I realized that I was using improper points to teleport the enemy. When I was calculating the size of the floor, he would grab a point just outside of the room corners because I calculated the corners incorrectly. The way I fixed this is by using the bottom corners of the walls to determine what spots where valid and then I subtracted by a small amount to further push the position further into the map, that way the sniper should never be spawned outside. Fixing this allows for the player to properly interact with the enemy and clear the room

Comments

Popular posts from this blog

Adding assets to every enemy -- Owen Meyers

Sphere to AABB collision