FlxOgmoLoader Import Collision Grid

12 views
Skip to first unread message

Nodens

unread,
Dec 23, 2015, 4:33:47 AM12/23/15
to HaxeFlixel


Hello all,

I'm currently playing with haxeflixel and so far it's really nice !

I have a question about the OgmoLoader...

The editor is really nice and the integration in HaxeFlixel is really handy but I can't find a way to import the Grid type layer in HaxeFlixel (I want to use it for the collisions).

Is there a way to import that type of layer ? or am I stuck with the types Tiles and Entities ?

Thank you for you time ;)

Nodens

unread,
Dec 24, 2015, 7:46:41 AM12/24/15
to HaxeFlixel
Hello again,

I could load the grid with by setting the export type to rectangles and then using the loadRectangles() function.

So now I have a list of FlxRect, how can I handle the collisions with that ? the FlxG.Collide() function seems to accept only the FlxBasic type.

I guess I can use the FlxRect.overlaps() function and creating a local rect with the player position/width/height, is this the right solution ?

Thank you for you help.
Reply all
Reply to author
Forward
0 new messages