Skip to content

Commit

Permalink
feat: Remove mock for the border colors; use actual player data
Browse files Browse the repository at this point in the history
  • Loading branch information
luanpotter committed Jul 2, 2023
1 parent f81e322 commit 86dcf92
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lib/game/components/game_border.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import 'package:flame/extensions.dart';
import 'package:flame/geometry.dart';
import 'package:flame/palette.dart';
import 'package:lightrunners/game/lightrunners_game.dart';
import 'package:lightrunners/ui/ui.dart';
import 'package:lightrunners/utils/flame_utils.dart';

const _radius = Radius.circular(5);
Expand Down Expand Up @@ -65,13 +64,8 @@ class GameBorder extends PositionComponent
}

List<(Color, Path)> _generateBorderClips(Rectangle clipArea) {
var ships = game.ships.values.map((ship) => (ship.paint.color, ship.score));
// TODO(luan): remove this mock once we have more ships
ships = [
(GamePalette.red, 5),
(GamePalette.green, 2),
(GamePalette.lightBlue, 1),
];
final ships =
game.ships.values.map((ship) => (ship.paint.color, ship.score));
final topShips = ships.sortedBy<num>((e) => -e.$2).take(3);
final totalScore = topShips.map((e) => e.$2).sum;
final best = topShips.first;
Expand Down

0 comments on commit 86dcf92

Please sign in to comment.