Updates demo game to use curves from the animation package
This commit is contained in:
@@ -553,28 +553,3 @@ class _ColorDiff {
|
||||
|
||||
_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';
|
||||
import 'package:sky/rendering/object.dart';
|
||||
import 'package:sky/widgets/framework.dart';
|
||||
import 'package:sky/widgets/navigator.dart';
|
||||
import 'package:sky/animation/curves.dart';
|
||||
import 'package:vector_math/vector_math_64.dart';
|
||||
|
||||
part 'game_demo_world.dart';
|
||||
|
||||
Reference in New Issue
Block a user