diff --git a/assets/audio/Infinite_Menu.mp3 b/assets/audio/Infinite_Menu.mp3 new file mode 100644 index 0000000..e88f8d1 Binary files /dev/null and b/assets/audio/Infinite_Menu.mp3 differ diff --git a/assets/images/runner/fall/fall0001.png b/assets/images/runner/fall/fall0001.png new file mode 100644 index 0000000..be88868 Binary files /dev/null and b/assets/images/runner/fall/fall0001.png differ diff --git a/assets/images/runner/fall/fall0002.png b/assets/images/runner/fall/fall0002.png new file mode 100644 index 0000000..912670c Binary files /dev/null and b/assets/images/runner/fall/fall0002.png differ diff --git a/assets/images/runner/fall/fall0003.png b/assets/images/runner/fall/fall0003.png new file mode 100644 index 0000000..71364f9 Binary files /dev/null and b/assets/images/runner/fall/fall0003.png differ diff --git a/assets/images/runner/fall/fall0004.png b/assets/images/runner/fall/fall0004.png new file mode 100644 index 0000000..cdf9ac0 Binary files /dev/null and b/assets/images/runner/fall/fall0004.png differ diff --git a/assets/images/runner/fall/fall0005.png b/assets/images/runner/fall/fall0005.png new file mode 100644 index 0000000..80c2ab8 Binary files /dev/null and b/assets/images/runner/fall/fall0005.png differ diff --git a/assets/images/runner/fall/fall0006.png b/assets/images/runner/fall/fall0006.png new file mode 100644 index 0000000..0d14144 Binary files /dev/null and b/assets/images/runner/fall/fall0006.png differ diff --git a/assets/images/runner/fall/fall0007.png b/assets/images/runner/fall/fall0007.png new file mode 100644 index 0000000..81a8d4b Binary files /dev/null and b/assets/images/runner/fall/fall0007.png differ diff --git a/assets/images/runner/fall/fall0008.png b/assets/images/runner/fall/fall0008.png new file mode 100644 index 0000000..217b93b Binary files /dev/null and b/assets/images/runner/fall/fall0008.png differ diff --git a/assets/images/runner/fall/fall0009.png b/assets/images/runner/fall/fall0009.png new file mode 100644 index 0000000..183e19a Binary files /dev/null and b/assets/images/runner/fall/fall0009.png differ diff --git a/assets/images/runner/fall/fall0010.png b/assets/images/runner/fall/fall0010.png new file mode 100644 index 0000000..8032c48 Binary files /dev/null and b/assets/images/runner/fall/fall0010.png differ diff --git a/assets/images/runner/fall/fall0011.png b/assets/images/runner/fall/fall0011.png new file mode 100644 index 0000000..ccf7067 Binary files /dev/null and b/assets/images/runner/fall/fall0011.png differ diff --git a/assets/images/runner/fall/fall0012.png b/assets/images/runner/fall/fall0012.png new file mode 100644 index 0000000..ea4274d Binary files /dev/null and b/assets/images/runner/fall/fall0012.png differ diff --git a/assets/images/runner/fall/fall0013.png b/assets/images/runner/fall/fall0013.png new file mode 100644 index 0000000..301a129 Binary files /dev/null and b/assets/images/runner/fall/fall0013.png differ diff --git a/assets/images/runner/fall/fall0014.png b/assets/images/runner/fall/fall0014.png new file mode 100644 index 0000000..26017c2 Binary files /dev/null and b/assets/images/runner/fall/fall0014.png differ diff --git a/assets/images/runner/fall/fall0015.png b/assets/images/runner/fall/fall0015.png new file mode 100644 index 0000000..398b5b3 Binary files /dev/null and b/assets/images/runner/fall/fall0015.png differ diff --git a/assets/images/runner/fall/fall0016.png b/assets/images/runner/fall/fall0016.png new file mode 100644 index 0000000..0be5f46 Binary files /dev/null and b/assets/images/runner/fall/fall0016.png differ diff --git a/assets/images/runner/fall/fall0017.png b/assets/images/runner/fall/fall0017.png new file mode 100644 index 0000000..f52764a Binary files /dev/null and b/assets/images/runner/fall/fall0017.png differ diff --git a/assets/images/runner/fall/fall0018.png b/assets/images/runner/fall/fall0018.png new file mode 100644 index 0000000..364373a Binary files /dev/null and b/assets/images/runner/fall/fall0018.png differ diff --git a/assets/images/runner/fall/fall0019.png b/assets/images/runner/fall/fall0019.png new file mode 100644 index 0000000..4562aab Binary files /dev/null and b/assets/images/runner/fall/fall0019.png differ diff --git a/assets/images/runner/fall/fall0020.png b/assets/images/runner/fall/fall0020.png new file mode 100644 index 0000000..d4174d2 Binary files /dev/null and b/assets/images/runner/fall/fall0020.png differ diff --git a/lib/bug_holder.dart b/lib/bug_holder.dart index d177f23..192ef0b 100644 --- a/lib/bug_holder.dart +++ b/lib/bug_holder.dart @@ -27,7 +27,7 @@ class BugHolder extends Holder { bool generateBug(MyGame gameRef, int level, {bool force = false, double xPosition = 0}) { - if (objects[level].isNotEmpty) { + if (objects[level].length > 2) { return false; } diff --git a/lib/debris_holder.dart b/lib/debris_holder.dart index 8d14c73..01ba466 100644 --- a/lib/debris_holder.dart +++ b/lib/debris_holder.dart @@ -20,7 +20,7 @@ class DebrisHolder extends Holder { bool generateDebris(MyGame gameRef, int level, {bool force = false, double xPosition = 0}) { - if (objects[level].isNotEmpty) { + if (objects[level].length > 1) { return false; } diff --git a/lib/game_state.dart b/lib/game_state.dart index 2a3edc0..b738f35 100644 --- a/lib/game_state.dart +++ b/lib/game_state.dart @@ -120,19 +120,19 @@ class GameState extends Component { if (!isPaused) { switch (getLevel()) { case 7: - return gameRef.viewport.canvasSize.x * 0.28; + return gameRef.viewport.canvasSize.x * 0.30; case 6: - return gameRef.viewport.canvasSize.x * 0.26; + return gameRef.viewport.canvasSize.x * 0.28; case 5: - return gameRef.viewport.canvasSize.x * 0.24; + return gameRef.viewport.canvasSize.x * 0.26; case 4: - return gameRef.viewport.canvasSize.x * 0.22; + return gameRef.viewport.canvasSize.x * 0.24; case 3: - return gameRef.viewport.canvasSize.x * 0.20; + return gameRef.viewport.canvasSize.x * 0.22; case 2: - return gameRef.viewport.canvasSize.x * 0.18; + return gameRef.viewport.canvasSize.x * 0.20; default: - return gameRef.viewport.canvasSize.x * 0.16; + return gameRef.viewport.canvasSize.x * 0.18; } } else { return 0; diff --git a/lib/main.dart b/lib/main.dart index 7798a22..b8715af 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -191,7 +191,11 @@ class MyGame extends BaseGame with PanDetector, TapDetector, KeyboardEvents { } void playMusic() { - FlameAudio.bgm.play('Infinite_Spankage_M.mp3'); + if (overlays.isActive('mainMenu')) { + FlameAudio.bgm.play('Infinite_Menu.mp3'); + } else { + FlameAudio.bgm.play('Infinite_Spankage_M.mp3'); + } playingMusic = true; } @@ -355,6 +359,8 @@ class MyGame extends BaseGame with PanDetector, TapDetector, KeyboardEvents { void mainMenu() { overlays.remove('gameOver'); overlays.add('mainMenu'); + FlameAudio.bgm.stop(); + FlameAudio.bgm.play('Infinite_Menu.mp3'); } void reset() { @@ -535,33 +541,41 @@ class MyGame extends BaseGame with PanDetector, TapDetector, KeyboardEvents { } print(event.data.logicalKey.keyId); print(event.data.keyLabel); - if (event is RawKeyUpEvent) { + if (event is RawKeyDownEvent) { + action = true; keyboardKey = null; - switch (event.data.keyLabel) { - case "w": + switch (event.data.logicalKey.keyId) { + case 4294968068: + case 119: + case 87: + // case "w": runner.control("up"); break; - case "a": + case 4294968066: + case 97: + case 65: + // case "a": runner.control("left"); break; - case "s": + case 4294968065: + case 115: + case 83: + // case "s": runner.control("down"); break; - case "d": + case 4294968067: + case 100: + case 68: + // case "d": runner.control("right"); break; default: - if (event.data.logicalKey.keyId == 32) { - runner.control("down"); - } break; } } - if (event is RawKeyDownEvent && event.data.logicalKey.keyId == 32) { - if (keyboardKey == null) { - runner.control("center"); - } - keyboardKey = "spacebar"; + + if (event is RawKeyUpEvent) { + action = false; } } } diff --git a/lib/main_menu_overlay.dart b/lib/main_menu_overlay.dart index 4d9fc55..692d3a5 100644 --- a/lib/main_menu_overlay.dart +++ b/lib/main_menu_overlay.dart @@ -1,3 +1,4 @@ +import 'package:flame_audio/flame_audio.dart'; import 'package:flutter/material.dart'; import 'main.dart'; @@ -66,6 +67,8 @@ class MainMenuOverlay extends StatelessWidget { onPressed: () { // Go to the Main Menu game.reset(); + FlameAudio.bgm.stop(); + FlameAudio.bgm.play('Infinite_Spankage_M.mp3'); }, ), // MaterialButton( diff --git a/lib/runner.dart b/lib/runner.dart index 1290f2a..1bdced6 100644 --- a/lib/runner.dart +++ b/lib/runner.dart @@ -697,12 +697,12 @@ class Runner extends Component with HasGameRef { SpriteAnimation.spriteList(floats3, stepTime: 0.02, loop: true); List falls = []; - for (int i = 1; i <= 38; i++) { + for (int i = 1; i <= 20; i++) { final composition = ImageComposition() - ..add(satellites.elementAt(i - 1), Vector2(0, 0)) + ..add(satellites.elementAt(((i - 1) % 20)), Vector2(0, 0)) ..add( await Flame.images.load( - 'runner/run/run00${i < 10 ? "0" + i.toString() : i.toString()}.png'), + 'runner/fall/fall00${i < 10 ? "0" + i.toString() : i.toString()}.png'), Vector2(0, 0)); falls.add(Sprite(await composition.compose())); diff --git a/lib/wall_holder.dart b/lib/wall_holder.dart index b3f0664..1c238c1 100644 --- a/lib/wall_holder.dart +++ b/lib/wall_holder.dart @@ -20,7 +20,7 @@ class WallHolder extends Holder { bool generateWall(MyGame gameRef, int level, {bool force = false, double xPosition = 0}) { - if (objects[level].isNotEmpty) { + if (objects[level].length > 1) { return false; } diff --git a/lib/wire_holder.dart b/lib/wire_holder.dart index 8f7f800..58af358 100644 --- a/lib/wire_holder.dart +++ b/lib/wire_holder.dart @@ -20,7 +20,7 @@ class WireHolder extends Holder { bool generateWire(MyGame gameRef, int level, {bool force = false, double xPosition = 0}) { - if (objects[level].isNotEmpty) { + if (objects[level].length > 1) { return false; } diff --git a/pubspec.yaml b/pubspec.yaml index 53fe684..f6bba87 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -59,6 +59,7 @@ flutter: - assets/audio/ - assets/audio/sfx/ - assets/images/runner/run/ + - assets/images/runner/fall/ - assets/images/runner/satellite/ - assets/images/runner/death/ - assets/images/runner/deathglitch/