Guest User

Untitled

a guest
Mar 16th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. public class GameWorld extends World
  2. {
  3. public var uni:Universe;
  4.  
  5. public var tileEnt:Entity;
  6.  
  7. public var bg:Backdrop;
  8. public var bge:Entity;
  9.  
  10. public var cl:Backdrop;
  11. public var cle:Entity;
  12.  
  13. public function GameWorld()
  14. {
  15.  
  16. }
  17.  
  18. override public function begin():void
  19. {
  20. uni = new Universe(500,500);
  21.  
  22. bg = new Backdrop(bitimp.bg1_c, true, true);
  23. bg.scrollX = 0.5;
  24. bg.scrollY = 0.5;
  25. bge = new Entity(0,0, bg);
  26. add(bge);
  27.  
  28. cl = new Backdrop(bitimp.clouds_c, true, true);
  29. cl.scrollX = 0.9;
  30. cl.scrollY = 0.9;
  31. cle = new Entity(0,0, cl);
  32. add(cle);
  33.  
  34. var s:String = "";
  35. while((s = uni.genRoid()) != null) trace(s);
  36. tileEnt = new Entity(0,0,uni.world);
  37.  
  38. add(tileEnt);
  39.  
  40. }
  41.  
  42. var lastTime:int;
  43. override public function update():void
  44. {
  45. var t:int = getTimer()-lastTime;
  46. lastTime += t;
  47. trace(t);
  48.  
  49. FP.camera.x += 10;
  50. FP.camera.y += 10;
  51. //camera.x = FP
  52. }
  53. }
Add Comment
Please, Sign In to add comment