One way platform?


(Froom7) #1

Hi there fellow developers,

I’m a bit curious here and I had this question long on my mind. I know that you can easily make a platformer game with a little help of Ogmo Editor or some kinda level editor. It easily integrates into your game and such, but here is the thing. How does one make an one way platform. In Flixel I know it’s super easy to do I think, but how can you achieve it in FP? I made some little test platformers and such. But I want also have some one way platforms.

So I hope there is a way to achieve this!


(Jacob Albano) #2

One thing you can do is override the MoveCollideY function on your platform class.

override public function moveCollideY(e:Entity):Boolean
{
    return e.bottom <= this.top;
}

If the entity is above the platform, it collides; if not, it doesn’t. You might need to tweak the code a little bit but it should get you off on the right track.


(Froom7) #3

Ah right, I see… Going to try that out for sure and I’ll see what I end up with.