FlxG.Collide outside of original stage?

22 views
Skip to first unread message

PTR

unread,
Jun 23, 2015, 6:32:59 PM6/23/15
to haxef...@googlegroups.com
How is it possible that the FlxG.Collide works perfectly if I stay within the original stage region, but when I exit, there is no collision at all?
I am using FlxCamera to follow an FlxSprite, and when I leave the 800x500 (px) original stage, the collider stops working. Is there something I'm missing? The collision is between an FlxSprite and an FlxSpriteGroup.

Gama11

unread,
Jun 24, 2015, 5:12:20 AM6/24/15
to haxef...@googlegroups.com, zang...@gmail.com
Collisions are limited to the area defined by FlxG.worldBounds, which defaults to the game size. Just increase that according to your needs.

PTR

unread,
Jun 24, 2015, 5:23:00 AM6/24/15
to haxef...@googlegroups.com, zang...@gmail.com
Thank you Gama!

I really like HaxeFlixel, but it is so weird sometimes.

PTR

unread,
Jun 24, 2015, 6:59:45 AM6/24/15
to haxef...@googlegroups.com, zang...@gmail.com
One more thing though, isn't it going to cause performance issues if I increase the size of the world bounds?


2015. június 24., szerda 11:12:20 UTC+2 időpontban Gama11 a következőt írta:

Gama11

unread,
Jun 24, 2015, 7:01:27 AM6/24/15
to haxef...@googlegroups.com, zang...@gmail.com
Well, a larger collision area is definitely more expensive, but you shouldn't experience performance issues because of that. Most of the time rendering is the bottleneck anyway.
Reply all
Reply to author
Forward
0 new messages