Rob Colbert
2 years ago
1 changed files with 26 additions and 0 deletions
@ -0,0 +1,26 @@ |
|||
// lib/behaviors/tween-runner.js
|
|||
// Copyright (C) 2022 Rob Colbert @[email protected]
|
|||
// License: Apache-2.0
|
|||
|
|||
/* |
|||
* The tween runner will execute a NiceTween on the target object, and it will |
|||
* terminate when the NiceTween terminates (if it terminates). |
|||
* |
|||
* To end a looping tween behavior, access the behavior (this object) and stop |
|||
* it's tween. |
|||
*/ |
|||
|
|||
'use strict'; |
|||
|
|||
export class TweenRunner { |
|||
|
|||
constructor (game, gameObject, tween) { |
|||
this.game = game; |
|||
this.gameObject = gameObject; |
|||
this.tween = tween; |
|||
} |
|||
|
|||
update (elapsed, now) { |
|||
return this.tween.update(elapsed, now); |
|||
} |
|||
} |
Loading…
Reference in new issue