P
Pixelope
Guest
Hi folks,
I've been racking my brains for the past few days, I'm working on a platform game which involves stairs to move up and down a building, but be able to explore each floor. I can get slopes to work to act as stairs, but then I want to be able to walk past the top and bottom of stairs to explore either side.
Picture below shows what I mean:
The basic concept I'm thinking of is that when the player collides with the stairs while pressing up/down (whilst moving left/right) it will then allow them to move up/down accordingly but I can't figure out a method to make it work.
As mentioned before I've tried slopes but can't figure out how I would pass through them.
I've looked into turning it into a 'ladder' at an angle but I can't figure that out, most tutorials I've seen for that show the player going through the ladder on either side once they climb up, obviously I don't want the player to phase through the steps whilst going up/down.
My other thought would be if the stairs have a different depth and the key press to go up/down would allow the player to switch to that 'layer', which would maybe be quite achievable. With this approach though I would think it will interfere with combat elements, as in the player might press up/down to phase through to that other 'layer' and dodge enemies. It would be ideal if enemies could use these stairs also.
I hope this makes sense, I'm not looking for the code, I'm currently learning gml and want to figure the actual code out myself, I just want to know which approach would be the most effective way, or if there's something I've missed.
Thanks in advance!
I've been racking my brains for the past few days, I'm working on a platform game which involves stairs to move up and down a building, but be able to explore each floor. I can get slopes to work to act as stairs, but then I want to be able to walk past the top and bottom of stairs to explore either side.
Picture below shows what I mean:
The basic concept I'm thinking of is that when the player collides with the stairs while pressing up/down (whilst moving left/right) it will then allow them to move up/down accordingly but I can't figure out a method to make it work.
As mentioned before I've tried slopes but can't figure out how I would pass through them.
I've looked into turning it into a 'ladder' at an angle but I can't figure that out, most tutorials I've seen for that show the player going through the ladder on either side once they climb up, obviously I don't want the player to phase through the steps whilst going up/down.
My other thought would be if the stairs have a different depth and the key press to go up/down would allow the player to switch to that 'layer', which would maybe be quite achievable. With this approach though I would think it will interfere with combat elements, as in the player might press up/down to phase through to that other 'layer' and dodge enemies. It would be ideal if enemies could use these stairs also.
I hope this makes sense, I'm not looking for the code, I'm currently learning gml and want to figure the actual code out myself, I just want to know which approach would be the most effective way, or if there's something I've missed.
Thanks in advance!
Attachments
-
7.5 KB Views: 14