Skip to content

Commit

Permalink
Necessary changes
Browse files Browse the repository at this point in the history
  • Loading branch information
spydon committed Sep 25, 2023
1 parent 18637e7 commit 356138d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/game/components/count_down.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:flutter/painting.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:lightrunners/ui/ui.dart';

const _matchLength = 4.0;
const _matchLength = 60.0;
const _radius = Radius.circular(3.0);

class CountDown extends PositionComponent {
Expand Down
4 changes: 2 additions & 2 deletions lib/game/components/score_panel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class ScorePanel extends RectangleComponent
with HasGameReference<LightRunnersGame> {
@override
void onLoad() {
position = Vector2(game.cameraComponent.viewport.size.x - scoreBoxWidth, 0);
size = Vector2(scoreBoxWidth, game.cameraComponent.viewport.size.y);
position = Vector2(game.camera.viewport.size.x - scoreBoxWidth, 0);
size = Vector2(scoreBoxWidth, game.camera.viewport.size.y);
paint = Paint()..color = GamePalette.black;
addAll(
game.ships.values.map(
Expand Down
3 changes: 1 addition & 2 deletions lib/game/lightrunners_game.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class LightRunnersGame extends FlameGame
with HasKeyboardHandlerComponents, HasCollisionDetection {
final List<Player> players;
late final Rect playArea;
late final CameraComponent cameraComponent;
late final Map<String, Ship> ships;

StreamSubscription<GamepadEvent>? _subscription;
Expand All @@ -43,7 +42,7 @@ class LightRunnersGame extends FlameGame
fixedSize.x - 2 * screenMargin - scoreBoxWidth - 2 * scoreBoxMargin,
fixedSize.y - 2 * screenMargin,
);
cameraComponent.viewport.add(ScorePanel());
camera.viewport.add(ScorePanel());
world.addAll([Background(), GameBorder()]);
world.addAll([Spotlight(), ...ships.values]);

Expand Down

0 comments on commit 356138d

Please sign in to comment.