1
1
import Phaser from 'phaser' ;
2
2
3
- import { key } from '../constants' ;
3
+ import { Image } from '../constants' ;
4
4
5
5
enum Animation {
6
6
Left = 'PlayerLeft' ,
@@ -21,7 +21,7 @@ export class Player extends Phaser.Physics.Arcade.Sprite {
21
21
scene : Phaser . Scene ,
22
22
x : number ,
23
23
y : number ,
24
- texture = key . image . dude ,
24
+ texture = Image . Dude ,
25
25
frame = 0 ,
26
26
) {
27
27
super ( scene , x , y , texture , frame ) ;
@@ -50,7 +50,7 @@ export class Player extends Phaser.Physics.Arcade.Sprite {
50
50
if ( ! anims . exists ( Animation . Left ) ) {
51
51
anims . create ( {
52
52
key : Animation . Left ,
53
- frames : anims . generateFrameNumbers ( key . image . dude , {
53
+ frames : anims . generateFrameNumbers ( Image . Dude , {
54
54
start : 0 ,
55
55
end : 3 ,
56
56
} ) ,
@@ -63,7 +63,7 @@ export class Player extends Phaser.Physics.Arcade.Sprite {
63
63
if ( ! anims . exists ( Animation . Turn ) ) {
64
64
anims . create ( {
65
65
key : Animation . Turn ,
66
- frames : [ { key : key . image . dude , frame : 4 } ] ,
66
+ frames : [ { key : Image . Dude , frame : 4 } ] ,
67
67
frameRate : 20 ,
68
68
} ) ;
69
69
}
@@ -72,7 +72,7 @@ export class Player extends Phaser.Physics.Arcade.Sprite {
72
72
if ( ! anims . exists ( Animation . Right ) ) {
73
73
anims . create ( {
74
74
key : Animation . Right ,
75
- frames : anims . generateFrameNumbers ( key . image . dude , {
75
+ frames : anims . generateFrameNumbers ( Image . Dude , {
76
76
start : 5 ,
77
77
end : 8 ,
78
78
} ) ,
0 commit comments