Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export default class DungeonScene extends Phaser.Scene {
- constructor() {
- super();
- // Constructor is called once when the scene is created for the first time. When the scene is
- // stopped/started (or restarted), the constructor will NOT be called again.
- this.level = 0;
- }
- create() {
- this.level++;
- // ... code omitted
- // Help text that has a "fixed" position on the screen
- this.add
- .text(16, 16, `Find the stairs. Go deeper.\nCurrent level: ${this.level}`, {
- font: "18px monospace",
- fill: "#000000",
- padding: { x: 20, y: 10 },
- backgroundColor: "#ffffff"
- })
- .setScrollFactor(0);
- }
- }
Add Comment
Please, Sign In to add comment