Commit 9cb2cdac authored by Viktor Lidholt's avatar Viktor Lidholt

Updates demo game to use curves from the animation package

parent dafaddff
...@@ -553,28 +553,3 @@ class _ColorDiff { ...@@ -553,28 +553,3 @@ class _ColorDiff {
_ColorDiff(this.alpha, this.red, this.green, this.blue); _ColorDiff(this.alpha, this.red, this.green, this.blue);
} }
double _bounce(double t)
{
if (t < 1.0 / 2.75) {
return 7.5625 * t * t;
} else if (t < 2 / 2.75) {
t -= 1.5 / 2.75;
return 7.5625 * t * t + 0.75;
} else if (t < 2.5 / 2.75) {
t -= 2.25 / 2.75;
return 7.5625 * t * t + 0.9375;
}
t -= 2.625 / 2.75;
return 7.5625 * t * t + 0.984375;
}
class BounceOutCurve implements Curve {
const BounceOutCurve();
double transform(double t) {
return _bounce(t);
}
}
const BounceOutCurve bounceOut = const BounceOutCurve();
...@@ -7,6 +7,7 @@ import 'sprites.dart'; ...@@ -7,6 +7,7 @@ import 'sprites.dart';
import 'package:sky/rendering/object.dart'; import 'package:sky/rendering/object.dart';
import 'package:sky/widgets/framework.dart'; import 'package:sky/widgets/framework.dart';
import 'package:sky/widgets/navigator.dart'; import 'package:sky/widgets/navigator.dart';
import 'package:sky/animation/curves.dart';
import 'package:vector_math/vector_math_64.dart'; import 'package:vector_math/vector_math_64.dart';
part 'game_demo_world.dart'; part 'game_demo_world.dart';
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment