Skip to content

Instantly share code, notes, and snippets.

@djanatyn
Created August 17, 2011 00:59
Show Gist options
  • Save djanatyn/1150556 to your computer and use it in GitHub Desktop.
Save djanatyn/1150556 to your computer and use it in GitHub Desktop.
java looks like actionscript
package
{
import net.flashpunk.Engine;
import net.flashpunk.FP;
public class Main extends Engine
{
public function Main()
{
super(800, 600, 60, false);
FP.world = new MyWorld;
}
}
}
package
{
import net.flashpunk.Entity;
import net.flashpunk.graphics.Image;
public class MyEntity extends Entity
{
[Embed(source = 'assets/player.png')] private const PLAYER:Class;
public function MyEntity()
{
graphic = new Image(PLAYER);
}
}
}
package
{
import net.flashpunk.World
public class MyWorld extends World
{
public function MyWorld()
{
add(new MyEntity);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment