File tree Expand file tree Collapse file tree 1 file changed +18
-12
lines changed Expand file tree Collapse file tree 1 file changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -52,18 +52,24 @@ export class CameraMoveEvent extends GameEvent {
52
52
const easing = point . easing ? _ . get ( Phaser . Easing , point . easing ) : Phaser . Easing . Linear . None ;
53
53
let promise_resolve ;
54
54
const promise = new Promise ( resolve => ( promise_resolve = resolve ) ) ;
55
- this . game . add
56
- . tween ( this . game . camera )
57
- . to (
58
- {
59
- x : x ,
60
- y : y ,
61
- } ,
62
- duration ,
63
- easing ,
64
- true
65
- )
66
- . onComplete . addOnce ( promise_resolve ) ;
55
+ if ( duration >= 30 ) {
56
+ this . game . add
57
+ . tween ( this . game . camera )
58
+ . to (
59
+ {
60
+ x : x ,
61
+ y : y ,
62
+ } ,
63
+ duration ,
64
+ easing ,
65
+ true
66
+ )
67
+ . onComplete . addOnce ( promise_resolve ) ;
68
+ } else {
69
+ this . game . camera . x = x ;
70
+ this . game . camera . y = y ;
71
+ promise_resolve ( ) ;
72
+ }
67
73
await promise ;
68
74
}
69
75
if ( this . reset_follow && camera_was_following ) {
You can’t perform that action at this time.
0 commit comments