-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathBootScene.js
More file actions
29 lines (23 loc) · 710 Bytes
/
Copy pathBootScene.js
File metadata and controls
29 lines (23 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import Phaser from 'phaser';
import images from './assets/*.png';
export default class BootScene extends Phaser.Scene {
constructor () {
super({ key: 'boot' });
}
preload () {
const bg = this.add.rectangle(400, 300, 400, 30, 0x666666);
const bar = this.add.rectangle(bg.x, bg.y, bg.width, bg.height, 0xffffff).setScale(0, 1);
console.table(images);
this.load.image('space', images.space);
this.load.image('logo', images.logo);
this.load.image('red', images.red);
this.load.on('progress', function (progress) {
bar.setScale(progress, 1);
});
}
update () {
this.scene.start('menu');
// this.scene.start('play');
// this.scene.remove();
}
}