Monday, July 25, 2011

FlashPunk + Flixel = Flxpunk

Do you want to use the Flixel movement code at the FlashPunk project?

net.flxpunk package:

  • FlxEntity – Extends Entity class with Flixel movement code (velocity, acceleration, path, etc.)
  • FlxTween – Movement controller as a FlashPunk Tween extension
  • FlxPathFinding – Path finding stuff. Used Grid for a collision map.
  • FlxPath – This is a simple path data container.
...
// a collision grid
var grid:Grid = new Grid(720, 480, 24, 24);
grid.loadFromString(new LEVEL());
...
var pf:FlxPathFinding = new FlxPathFinding(grid);
var path:FlxPath= pf.findPath(unit.flx.getMidpoint(), new Point(mouseX, mouseY), true);
unit.flx.followPath(path, 60, FlxPath.PATH_FORWARD);
...

Github wiki
Download source code with example  

Read more: FlashPunk + Flixel = Flxpunk

No comments:

Post a Comment