Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buttons spacing and enemy removal #4

Merged
merged 2 commits into from Dec 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/game/enemy.dart
Expand Up @@ -39,7 +39,7 @@ class Enemy extends SpriteAnimationComponent

// Remove the enemy and increase player score
// by 1, if enemy has gone past left end of the screen.
if (position.x < -5) {
if (position.x < -enemyData.textureSize.x) {
remove();
gameRef.playerData.currentScore += 1;
}
Expand Down
6 changes: 4 additions & 2 deletions lib/widgets/game_over_menu.dart
Expand Up @@ -36,8 +36,10 @@ class GameOverMenu extends StatelessWidget {
child: Padding(
padding:
const EdgeInsets.symmetric(vertical: 20, horizontal: 100),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
child: Wrap(
direction: Axis.vertical,
crossAxisAlignment: WrapCrossAlignment.center,
spacing: 10,
children: [
const Text(
'Game Over',
Expand Down
6 changes: 4 additions & 2 deletions lib/widgets/main_menu.dart
Expand Up @@ -30,8 +30,10 @@ class MainMenu extends StatelessWidget {
child: Padding(
padding:
const EdgeInsets.symmetric(vertical: 20, horizontal: 100),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
child: Wrap(
direction: Axis.vertical,
crossAxisAlignment: WrapCrossAlignment.center,
spacing: 10,
children: [
const Text(
'Dino Run',
Expand Down
6 changes: 4 additions & 2 deletions lib/widgets/pause_menu.dart
Expand Up @@ -35,8 +35,10 @@ class PauseMenu extends StatelessWidget {
child: Padding(
padding:
const EdgeInsets.symmetric(vertical: 20, horizontal: 100),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
child: Wrap(
direction: Axis.vertical,
crossAxisAlignment: WrapCrossAlignment.center,
spacing: 10,
children: [
Padding(
padding: const EdgeInsets.all(10),
Expand Down