-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample2.js
More file actions
46 lines (28 loc) · 838 Bytes
/
Example2.js
File metadata and controls
46 lines (28 loc) · 838 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
class Example2 extends Phaser.Scene {
constructor(){
super({key:"Example2"});
}
create(){
this.text = this.add.text(0,0,"Welcome to Example2!", {font:"40px Impact"});
var tween = this.tweens.add({
targets: this.text,
x:200,
y:250,
duration:2000,
ease:"Elastic",
easeParams:[1.5,0.5],
delay:1000,
onComplete:function(src,tgt){
tgt[0].x = 0;
tgt[0].y = 0;
tgt[0].setColor("Red");
}
},this);
this.key_1 = this.input.keyboard.addKey(Phaser.Input.Keyboard.KeyCodes.ONE);
// update(delta){
// if(this.key_1.isDown){
// this.scene.start("Example1");
//}
//}
}
}