Skip to content

Commit 3f93488

Browse files
authored
Merge branch 'master' into master
2 parents 49c2643 + b2fe94e commit 3f93488

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/scripts/excalibur.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import * as ex from 'excalibur';
22
import Engine from './engine.js';
33

4+
const spriteImage = new ex.ImageSource('sprite.png');
5+
6+
const loader = new ex.Loader([spriteImage]);
7+
48
export class Scene extends ex.Scene {
59
particles = [];
610
onActivate(ctx) {
@@ -83,12 +87,12 @@ class ExcaliburEngine extends Engine {
8387
window.cancelAnimationFrame(this.request);
8488
if (this.game) {
8589
this.game.dispose();
86-
this.canvas = document.createElement("canvas");
87-
this.canvas.id = "canvas";
88-
this.canvas.className = "canvas";
90+
this.canvas = document.createElement('canvas');
91+
this.canvas.id = 'canvas';
92+
this.canvas.className = 'canvas';
8993
this.canvas.width = this.width;
9094
this.canvas.height = this.height;
91-
document.querySelector("main").appendChild(this.canvas);
95+
document.querySelector('main').appendChild(this.canvas);
9296
}
9397

9498
const game = new ex.Engine({
@@ -97,12 +101,13 @@ class ExcaliburEngine extends Engine {
97101
canvasElement: this.canvas,
98102
physics: false, // this benchmark is only doing drawing
99103
backgroundColor: ex.Color.fromRGB(26, 26, 26),
100-
scenes: { scene: Scene }
104+
suppressPlayButton: true,
105+
scenes: { scene: Scene },
101106
});
102107
this.game = game;
103108
}
104109
render() {
105-
this.game.start().then(() => {
110+
this.game.start(loader).then(() => {
106111
this.game.goToScene('scene', { sceneActivationData: { engine: this } });
107112
});
108113
}

0 commit comments

Comments
 (0)