Dynamic Collision Area (Flixel)
From Flash Game Dojo
Flixel's collision detection is great, but for large-area games (platformers, etc.) it's impractical to hit test the whole area of the game in every frame. Here is how to check for collisions in ONLY the area of the screen that is currently in the game's view.
Inside your State class:
override public function update():void { FlxU.setWorldBounds(-(FlxG.scroll.x), -(FlxG.scroll.y), FlxG.width, FlxG.height); collide() super.update(); }
Retrieved from "flashgamedojo.com/wiki/index.php?title=Dynamic_Collision_Area_(Flixel)"
Categories: Snippets | Flixel