-
Notifications
You must be signed in to change notification settings - Fork 0
/
controls.js
31 lines (27 loc) · 1.09 KB
/
controls.js
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
30
31
export default class Controls {
preload() {
this.game.load.image('BG', './assets/background2.jpg');
this.load.spritesheet('back', './assets/button_zuruck.png', 108, 40);
this.game.load.image('phone', './assets/phone.png');
this.game.load.image('Roger', './assets/roger3.png');
this.game.load.image('Finger', './assets/finger2.png');
};
create() {
this.add.image(0, 0, 'BG');
this.add.image(this.world.centerX - 320, 250, 'Roger');
this.add.image(10, 250, 'phone');
const finger = this.add.image(80, 450, 'Finger');
this.add.button(this.world.centerX - 150, 660, 'back', this.goBack, this, 2, 1, 0);
const text = this.game.add.text(this.world.centerX - 170, this.world.height - 730, ' Spieler 1: A und S\n Spieler 2: Pfeiltasten\n oder Touch-Eingabe' , {
font: "64px Arial",
fill: "#ffffff",
algin: "center"
});
text.scale.setTo(0.5, 0.5);
finger.scale.setTo(0.4, 0.4);
}
update() {}
goBack() {
this.state.start('welcome')
}
}