Added Menu music, increased difficulty, and added last animation.
BIN
assets/audio/Infinite_Menu.mp3
Normal file
BIN
assets/images/runner/fall/fall0001.png
Normal file
After Width: | Height: | Size: 59 KiB |
BIN
assets/images/runner/fall/fall0002.png
Normal file
After Width: | Height: | Size: 59 KiB |
BIN
assets/images/runner/fall/fall0003.png
Normal file
After Width: | Height: | Size: 59 KiB |
BIN
assets/images/runner/fall/fall0004.png
Normal file
After Width: | Height: | Size: 59 KiB |
BIN
assets/images/runner/fall/fall0005.png
Normal file
After Width: | Height: | Size: 59 KiB |
BIN
assets/images/runner/fall/fall0006.png
Normal file
After Width: | Height: | Size: 58 KiB |
BIN
assets/images/runner/fall/fall0007.png
Normal file
After Width: | Height: | Size: 59 KiB |
BIN
assets/images/runner/fall/fall0008.png
Normal file
After Width: | Height: | Size: 58 KiB |
BIN
assets/images/runner/fall/fall0009.png
Normal file
After Width: | Height: | Size: 59 KiB |
BIN
assets/images/runner/fall/fall0010.png
Normal file
After Width: | Height: | Size: 58 KiB |
BIN
assets/images/runner/fall/fall0011.png
Normal file
After Width: | Height: | Size: 58 KiB |
BIN
assets/images/runner/fall/fall0012.png
Normal file
After Width: | Height: | Size: 58 KiB |
BIN
assets/images/runner/fall/fall0013.png
Normal file
After Width: | Height: | Size: 58 KiB |
BIN
assets/images/runner/fall/fall0014.png
Normal file
After Width: | Height: | Size: 58 KiB |
BIN
assets/images/runner/fall/fall0015.png
Normal file
After Width: | Height: | Size: 58 KiB |
BIN
assets/images/runner/fall/fall0016.png
Normal file
After Width: | Height: | Size: 58 KiB |
BIN
assets/images/runner/fall/fall0017.png
Normal file
After Width: | Height: | Size: 59 KiB |
BIN
assets/images/runner/fall/fall0018.png
Normal file
After Width: | Height: | Size: 59 KiB |
BIN
assets/images/runner/fall/fall0019.png
Normal file
After Width: | Height: | Size: 58 KiB |
BIN
assets/images/runner/fall/fall0020.png
Normal file
After Width: | Height: | Size: 59 KiB |
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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(
|
||||
|
@ -697,12 +697,12 @@ class Runner extends Component with HasGameRef<MyGame> {
|
||||
SpriteAnimation.spriteList(floats3, stepTime: 0.02, loop: true);
|
||||
|
||||
List<Sprite> 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()));
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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/
|
||||
|