Guest User

Untitled

a guest
Jul 22nd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. export default class DungeonScene extends Phaser.Scene {
  2. constructor() {
  3. super();
  4.  
  5. // Constructor is called once when the scene is created for the first time. When the scene is
  6. // stopped/started (or restarted), the constructor will NOT be called again.
  7. this.level = 0;
  8. }
  9.  
  10. create() {
  11. this.level++;
  12.  
  13. // ... code omitted
  14.  
  15. // Help text that has a "fixed" position on the screen
  16. this.add
  17. .text(16, 16, `Find the stairs. Go deeper.\nCurrent level: ${this.level}`, {
  18. font: "18px monospace",
  19. fill: "#000000",
  20. padding: { x: 20, y: 10 },
  21. backgroundColor: "#ffffff"
  22. })
  23. .setScrollFactor(0);
  24. }
  25. }
Add Comment
Please, Sign In to add comment