Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
fix: adapt leap breaking changes (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsgalarraga authored Nov 2, 2023
1 parent 30b91f7 commit 7e669bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/game/entities/player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class Player extends JumperCharacter<DashRunGame> {
if (isDead) return game.gameOver();

// Player falls in a hazard zone.
if ((collisionInfo.downCollision?.isHazard ?? false) &&
if ((collisionInfo.downCollision?.tags.contains('hazard') ?? false) &&
!isPlayerInvincible) {
// If player has no golden feathers, game over.
if (powerUps.isEmpty) return game.gameOver();
Expand Down
7 changes: 4 additions & 3 deletions test/game/behaviors/follow_path_behavior_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:dash_run/game/game.dart';
import 'package:flame/components.dart';
import 'package:flame/effects.dart';
import 'package:flame_test/flame_test.dart';
import 'package:flame_tiled/flame_tiled.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:leap/leap.dart';
import 'package:mocktail/mocktail.dart';
Expand All @@ -20,7 +21,7 @@ void main() {
_TestGame.new,
(game) async {
final pathxp = Pathxp('{L, R}');
final parent = PhysicalEntity();
final parent = LeapMapGroundTile(Tile(localId: 0), 0, 0);
final behavior = FollowPathBehavior(pathxp);

await game.ensureAdd(parent);
Expand All @@ -44,7 +45,7 @@ void main() {
_TestGame.new,
(game) async {
final pathxp = Pathxp('{2L, R}');
final parent = PhysicalEntity();
final parent = LeapMapGroundTile(Tile(localId: 0), 0, 0);
final behavior = FollowPathBehavior(pathxp);

await game.ensureAdd(parent);
Expand All @@ -68,7 +69,7 @@ void main() {
_TestGame.new,
(game) async {
final pathxp = Pathxp('{L, R}');
final parent = PhysicalEntity();
final parent = LeapMapGroundTile(Tile(localId: 0), 0, 0);
final behavior = FollowPathBehavior(pathxp);

await game.ensureAdd(parent);
Expand Down

0 comments on commit 7e669bb

Please sign in to comment.