Created
August 17, 2011 00:59
-
-
Save djanatyn/1150556 to your computer and use it in GitHub Desktop.
java looks like actionscript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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