From 9cb2cdacba17a23aef6eb503927acf86e4820d2b Mon Sep 17 00:00:00 2001 From: Viktor Lidholt Date: Mon, 17 Aug 2015 17:07:55 -0700 Subject: [PATCH] Updates demo game to use curves from the animation package --- examples/game/lib/action.dart | 25 ------------------------- examples/game/lib/game_demo.dart | 1 + 2 files changed, 1 insertion(+), 25 deletions(-) diff --git a/examples/game/lib/action.dart b/examples/game/lib/action.dart index ceabdad660..331da4a895 100644 --- a/examples/game/lib/action.dart +++ b/examples/game/lib/action.dart @@ -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(); diff --git a/examples/game/lib/game_demo.dart b/examples/game/lib/game_demo.dart index c0edc9c56c..ff839168e2 100644 --- a/examples/game/lib/game_demo.dart +++ b/examples/game/lib/game_demo.dart @@ -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';