| Index: sky/sdk/example/game/lib/action.dart
|
| diff --git a/sky/sdk/example/game/lib/action.dart b/sky/sdk/example/game/lib/action.dart
|
| index 0c6119d528a3937a7b938b18fba62953699ac465..5a257d95ebd8ff57cb74e08d1cc61b0af3692146 100644
|
| --- a/sky/sdk/example/game/lib/action.dart
|
| +++ b/sky/sdk/example/game/lib/action.dart
|
| @@ -19,10 +19,12 @@ abstract class ActionInterval extends Action {
|
| bool _firstTick = true;
|
| double _elapsed = 0.0;
|
|
|
| + @override
|
| double get duration => _duration;
|
|
|
| ActionInterval([this._duration = 0.0]);
|
|
|
| + @override
|
| void step(double dt) {
|
| if (_firstTick) {
|
| _firstTick = false;
|
| @@ -51,6 +53,7 @@ class ActionRepeat extends ActionInterval {
|
| _duration = action.duration * numRepeats;
|
| }
|
|
|
| + @override
|
| void update(double t) {
|
| action.update((t * numRepeats.toDouble()) % numRepeats.toDouble());
|
| }
|
| @@ -82,6 +85,7 @@ class ActionSequence extends ActionInterval {
|
| }
|
| }
|
|
|
| + @override
|
| void update(double t) {
|
| if (t < _split) {
|
| // Play first action
|
| @@ -112,9 +116,11 @@ class ActionSequence extends ActionInterval {
|
|
|
| abstract class ActionInstant extends Action {
|
|
|
| + @override
|
| void step(double dt) {
|
| }
|
|
|
| + @override
|
| void update(double t) {
|
| fire();
|
| _finished = true;
|
| @@ -128,6 +134,7 @@ class ActionCallFunction extends ActionInstant {
|
|
|
| ActionCallFunction(this._function);
|
|
|
| + @override
|
| void fire() {
|
| _function();
|
| }
|
| @@ -138,6 +145,7 @@ class ActionRemoveNode extends ActionInstant {
|
|
|
| ActionRemoveNode(this._node);
|
|
|
| + @override
|
| void fire() {
|
| _node.removeFromParent();
|
| }
|
| @@ -149,6 +157,7 @@ class ActionRepeatForever extends Action {
|
|
|
| ActionRepeatForever(this.action);
|
|
|
| + @override
|
| step(double dt) {
|
| _elapsedInAction += dt;
|
| while (_elapsedInAction > action.duration) {
|
| @@ -198,6 +207,7 @@ class ActionTween extends ActionInterval {
|
| }
|
| }
|
|
|
| + @override
|
| void update(double t) {
|
| var newVal;
|
|
|
|
|