DEV Community

Dustin Runnells
Dustin Runnells

Posted on

Stairs Problems

Stairs are a challenge for me in this game. I want the sprites to have a way to get to other floors without only using the hammer to punch a hole. Stairs seemed like an obvious solution. I originally thought that since I have left and right moving sprites on a slightly different z position that just having the stairs in that same orientation for up and down would "just work". I had not considered how sprites would react when they encountered the staircase from the wrong side. I chose to just have them ignore the stairs unless they run into the staircase from the expected direction. This seems to work, but I won't be able to double up two staircases as pictured below and have a sprite travel from the third floor all the way down to the first since they will always run into the "up" staircase whenever they are walking left. I might just decide to live with this quirk and make sure that my levels are built in a way that this isn't a problem.

Image description

There is something weird with the speed of the sprites walking down the stairs. I'll need to investigate the physics parameters that might cause this (friction?).

To get the stairs to work, I had the opportunity to implement adding props to rooms. I'm hoping to make some lockers and other interesting features for the school that this game takes place in.

Next up:

  • Fix stair walking speed
  • Add ability to launch a sprite over something in a room (hole or stair opening)
  • Add ability to break hole in left or right wall

Top comments (0)