Any Ideas how to do this?
I don’t understand what you mean - do want to allow a sprite to move through walls?
No. Yes. Well Partially. Only passable from below, but you can’t go down.
if so I haven’t used tilemaps for a while but I believe you can ‘ghost’?
if the players y < the tiles
Yeah, this seems like the best approach to writing something like this – some combination of
ghost through walls,
on wall hit, and comparing the wall you hit’s position vs the player’s to see if it’s above or below. Possibly could also try something along the lines of disabling wall temporarily when the player goes through from the bottom (set wall off at location when hit from bottom) and reenabling it when the player gets above it?
Perhaps you could use something like this.
This is not using a tilemap, so there is no concept of walls. The code keeps checking that the player overlaps a platform.
Due to events between sprites and tiles/walls are handled in the main thread (of the game engine), require some exts (runLater) or ts code
I have noticed a strange bug. If I have the player jump two, it moves off the screen and does not return. Also if I move under the second platform and jump once it moves up off the screen (maybe because the player is still touching a tile at the top?)
Here’s the best I could do in blocks:
The code is a little complicated, but I added some comments. Also, doesn’t work great
@richard, perhaps add this feature to the platformer extension? I think it would be a nice one to have.
Hmm, it seems as if it crashes when you collide with a dropthrough platform on the side.