Advertisement
YellowAfterlife

Untitled

Nov 16th, 2013
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Haxe 0.62 KB | None | 0 0
  1. package ;
  2. import ncw.Bitmap;
  3. import ncw.Lib;
  4. import ncw.simple.Game;
  5. import ncw.simple.Scene;
  6. import ncw.simple.Entity;
  7.  
  8. class Main extends Game {
  9.     public static var someBitmap:Bitmap;
  10.     public function new() {
  11.         super(320, 360);
  12.         background = 0xfff9f9f9;
  13.         someBitmap = Bitmap.load("img/0.png");
  14.         scene = new Scene();
  15.         scene.add(new One());
  16.     }
  17.     public static function main() { new Main(); }
  18. }
  19.  
  20. class One extends Entity {
  21.     //
  22.     public function new() {
  23.         super();
  24.     }
  25.     function onFrame() {
  26.         x += Lib.delta * 4;
  27.         y = game.mouseY;
  28.     }
  29.     function onRender(to:Bitmap) {
  30.         to.draw(Main.someBitmap, x, y);
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement