ajuda.js 909 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Phaser3 example game
  2. // tutorial scene
  3. var TutorScene = new Phaser.Class({
  4. Extends: Phaser.Scene,
  5. initialize:
  6. function TutorScene ()
  7. {
  8. Phaser.Scene.call(this, { key: 'tutorscene' });
  9. },
  10. preload: function ()
  11. {
  12. },
  13. create: function ()
  14. {
  15. // add logo
  16. //this.sys.config.backgroundColor = '#f3cca3';
  17. var logo = this.add.sprite(400, 100, 'sprites', 'phaser3');
  18. // text
  19. var txt = this.add.bitmapText(400, 300, 'fontwhite', 'This is an example game.\nTake a look at the code\nto see how it works.');
  20. txt.setOrigin(0.5).setCenterAlign();
  21. // back Button
  22. this.btnback = this.addButton(400, 520, 'sprites', this.doBack, this, 'btn_back_hl', 'btn_back', 'btn_back_hl', 'btn_back');
  23. console.log('create is ready');
  24. },
  25. doBack: function ()
  26. {
  27. console.log('doBack was called!');
  28. this.scene.start('mainmenu');
  29. }
  30. });