[How to] Make terraria type platforms?

If you’ve played terraria you know what I mean. Its the type of platform where you can press your jump button to go through it, and then when you press the down button it goes down again. I’m making a boss rush game and this would be very helpful for a bullet hell

CBG did a very interesting one way gate sort of thing. It was nicer logic than my drop platform. Now that we have raycast, you should just be able to raycast at 180 below you for half platforms, and connect that raycast to AND gate. Connect down to the other part of AND gate, so when you are raycasting a drop block below you and press down, AND will work. Have AND connect to like 15 or -15 y, or whatever number is about half of your sprite size in pixels, then position. When you press down on the platform, you will drop pixels with proximity and clip the ground and fall through.

Do basically the same in reverse for raycast above you and up, to clip above a block through it.

Should work. Proximity might be better that raycast but I don’t know yet. Haven’t tried it.


I tried making something up, basically the floors aren’t solid but when the player is above them to a certain point they continually spawn a solid floor. when the player jumps or drops down with W/S the spawning temporarily stops to allow you to pass through the floors. Something neat is that you can hold S and fall through as many floors as you like. It would be easier to toggle on/off the physics but I didn’t, maybe you can do that. Not sure how having ghost floors will affect other units beside the player either lol

It’s also pretty buggy, some don’t make spawn solid floors for whatever reason when the others do. Deleting and replacing the floors and re-running seemed to fix it for a bit, but that’s not something you should have to do for a real game. I don’t like sidescrolling games so I don’t think I’ll try this out for real anyway though