@@ -8,7 +8,10 @@ import 'package:leap_standard_platformer/info_text.dart';
88import 'package:leap_standard_platformer/main.dart' ;
99
1010class Player extends JumperCharacter
11- with HasGameRef <ExamplePlatformerLeapGame >, HasHealth , HasAnimationGroup {
11+ with
12+ HasGameReference <ExamplePlatformerLeapGame >,
13+ HasHealth ,
14+ HasAnimationGroup {
1215 Player () {
1316 // Behaviors, ordering is important for processing
1417 // collision detection and reacting to inputs
@@ -87,9 +90,9 @@ class Player extends JumperCharacter
8790 void updateCollisionInteractions (double dt) {}
8891
8992 void _checkForLevelCompletion () {
90- final coinsLeft = gameRef .leapMap.children.whereType <Coin >().length;
93+ final coinsLeft = game .leapMap.children.whereType <Coin >().length;
9194 if (coinsLeft <= 1 ) {
92- gameRef .levelCleared ();
95+ game .levelCleared ();
9396 }
9497 }
9598}
@@ -294,12 +297,12 @@ enum _AnimationState { idle, walk, jump, fall, death, ladder }
294297
295298class PlayerSpriteAnimation
296299 extends AnchoredAnimationGroup <_AnimationState , Player >
297- with HasGameRef <LeapGame > {
300+ with HasGameReference <LeapGame > {
298301 PlayerSpriteAnimation () : super (scale: Vector2 .all (2 ));
299302
300303 @override
301304 Future <void >? onLoad () async {
302- final spritesheet = await gameRef .images.load ('player_spritesheet.png' );
305+ final spritesheet = await game .images.load ('player_spritesheet.png' );
303306
304307 animations = {
305308 _AnimationState .idle: SpriteAnimation .fromFrameData (
0 commit comments