Skip to content

Instantly share code, notes, and snippets.

@videlais
Created October 23, 2013 04:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save videlais/7112476 to your computer and use it in GitHub Desktop.
Save videlais/7112476 to your computer and use it in GitHub Desktop.
ActionScript 3 Example 7 PlayState Version 1
package
{
/**
* ...
* @author Dan Cox
*/
import org.flixel.*;
public class PlayState extends FlxState
{
private var map:MapGroup;
private var NPCGroup:NPCSpriteGroup;
public function PlayState()
{
}
override public function create():void
{
map = new MapGroup();
add(map);
Registry.player = new PlayerSprite(32, 32);
add(Registry.player);
NPCGroup = new NPCSpriteGroup();
add(NPCGroup);
FlxG.worldBounds = new FlxRect(0, 0, 640, 640);
FlxG.camera.setBounds(0, 0, 640, 640, true);
FlxG.camera.follow(Registry.player);
Registry.player.cameras = new Array(FlxG.camera);
}
override public function update():void
{
super.update();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment