TheoAllen

Untitled

Dec 5th, 2018
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. //=============================================================================
  2. // main.js
  3. //=============================================================================
  4.  
  5. function Scene_Example() {
  6. this.initialize.apply(this, arguments);
  7. }
  8.  
  9. Scene_Example.prototype = Object.create(Stage.prototype);
  10. Scene_Example.prototype.constructor = Scene_Example;
  11.  
  12. Scene_Example.prototype.initialize = function() {
  13. Stage.prototype.initialize.call(this);
  14. this._spr = new Sprite();
  15. this._spr.bitmap = ImageManager.loadFace('Actor1');
  16. this.addChild(this._spr);
  17. };
  18.  
  19. Scene_Example.prototype.update = function(){
  20. requestAnimationFrame(this.updateEx.bind(this));
  21. }
  22.  
  23. Scene_Example.prototype.updateEx = function() {
  24. Graphics.render(this);
  25. Input.update();
  26. TouchInput.update();
  27. }
  28.  
  29. // PluginManager.setup($plugins);
  30.  
  31. window.onload = function() {
  32. // var spr = new Sprite();
  33. // spr.bitmap = ImageManager.loadFace('Actor1', 0);
  34. // this.addChild(spr);
  35. //SceneManager.initialize();
  36. // console.log("Print this");
  37. var scene = new Scene_Example();
  38. while(true){
  39. scene.update();
  40. }
  41. // SceneManager.run(Scene_Boot);
  42. };
Advertisement
Add Comment
Please, Sign In to add comment