Skip to content

Commit

Permalink
Merge pull request #4 from karniv00l/buttons-spacing
Browse files Browse the repository at this point in the history
Buttons spacing and enemy removal
  • Loading branch information
ufrshubham committed Dec 5, 2021
2 parents 253c243 + c19008e commit 876ac33
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
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

0 comments on commit 876ac33

Please sign in to comment.