Browse Source

TweenRunner game object behavior

develop
Rob Colbert 2 years ago
parent
commit
3a9b6457de
  1. 26
      game/js/lib/object-behaviors/tween-runner.js

26
game/js/lib/object-behaviors/tween-runner.js

@ -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…
Cancel
Save