Skip to content

Commit

Permalink
change position of mini map button
Browse files Browse the repository at this point in the history
  • Loading branch information
xjyribro committed Feb 26, 2024
1 parent 710132a commit 3b4d85f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
4 changes: 3 additions & 1 deletion lib/constants/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ const double viewportHeight = 400;
const double boxMarginFromLeft = 28;
const double miniMapMarginFromLeft = 144;
const double dialogueBoxMarginFromTop = 270;
const double rightSideButtonFromLeft = 700;
const double rightSideButtonFromTop = 250;

// map
const double tileSize = 32;
Expand All @@ -28,7 +30,7 @@ const double miniMapSizeY = 382;

// game
const int playerSize = 32;
const int playerBaseSpeed = 16;
const int playerBaseSpeed = 3;
const int playerFastSpeed = 6;
const double npcSpeed = 2;
const double maxRaycastDist = 40;
Expand Down
5 changes: 3 additions & 2 deletions lib/game/ui/hud/exit_room_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ import 'package:flame/components.dart';
import 'package:flame/input.dart';
import 'package:flutter/material.dart';
import 'package:gomiland/assets.dart';
import 'package:gomiland/constants/constants.dart';
import 'package:gomiland/game/game.dart';

class ExitRoomButton extends HudMarginComponent
with HasGameReference<GomilandGame> {
ExitRoomButton({
required Function leaveRoomCheck,
super.margin = const EdgeInsets.only(
left: 700,
top: 250,
left: rightSideButtonFromLeft,
top: rightSideButtonFromTop,
),
}) : super() {
_leaveRoomCheck = leaveRoomCheck;
Expand Down
11 changes: 9 additions & 2 deletions lib/game/ui/hud/mini_map_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@ import 'package:flame/components.dart';
import 'package:flame/input.dart';
import 'package:flutter/material.dart';
import 'package:gomiland/assets.dart';
import 'package:gomiland/constants/constants.dart';
import 'package:gomiland/game/game.dart';
import 'package:gomiland/game/ui/hud/mini_map.dart';

class MiniMapButton extends HudMarginComponent with HasGameReference<GomilandGame> {
MiniMapButton({super.margin = const EdgeInsets.only(left: 32, top: 160)});
class MiniMapButton extends HudMarginComponent
with HasGameReference<GomilandGame> {
MiniMapButton({
super.margin = const EdgeInsets.only(
left: rightSideButtonFromLeft,
top: rightSideButtonFromTop,
),
});

@override
Future<void> onLoad() async {
Expand Down

0 comments on commit 3b4d85f

Please sign in to comment.