how do you detect walls?

crazybark

Member
im trying to make a character who passively runs along walls (like knuckles climbing but with a different animation) and was wondering if you could detect walls to your side, and if so how?
 
I suggest using the searchBlockmap function which allows you to do just that with the "lines" option. Just supply your player object with no x1, x2, y1, y2 and it will use the player's hitbox as reference instead which should make for accurate line "collision" detection.
From there all you'll need to do is make sure this line is actually a wall (by checking floor/ceiling heights and FOFs within the sector compared to the sector you're currently in).
 

Who is viewing this thread (Total: 0, Members: 0, Guests: 0)

Back
Top