Skip to content

Commit

Permalink
creates game scenes
Browse files Browse the repository at this point in the history
  • Loading branch information
ceceliacreates committed Sep 14, 2023
1 parent 0ecb4cd commit 571e34a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
16 changes: 16 additions & 0 deletions src/game/PlayScene.js
@@ -0,0 +1,16 @@
import { Scene } from "phaser";

export class PlayScene extends Scene {
constructor () {
super({ key: 'PlayScene' })
}

create () {
this.add.text(100, 100, "PlayScene", {
font: "24px Courier",
fill: "#ffffff",
});

}

}
Empty file added src/game/ScoreScene.js
Empty file.
20 changes: 3 additions & 17 deletions src/game/game.js
@@ -1,19 +1,5 @@
import { Game, AUTO, Scale, Scene} from "phaser";

export class MainScene extends Scene {
constructor () {
super({ key: 'MainScene' })
}

create () {
this.add.text(100, 100, "Hello Phaser!", {
font: "24px Courier",
fill: "#ffffff",
});

}

}
import { Game, AUTO, Scale } from "phaser";
import { PlayScene } from "./PlayScene.js";

export function launch() {
return new Game({
Expand All @@ -29,6 +15,6 @@ export function launch() {
physics: {
default: "arcade",
},
scene: MainScene,
scene: PlayScene,
});
}

0 comments on commit 571e34a

Please sign in to comment.