diff --git a/assets/images/kick-frames.png b/assets/images/kick-frames.png index 6589fc9..d881f97 100644 Binary files a/assets/images/kick-frames.png and b/assets/images/kick-frames.png differ diff --git a/lib/main.dart b/lib/main.dart index 4eb39e9..c0b0c41 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -5,6 +5,7 @@ import 'package:firo_runner/circuit_background.dart'; import 'package:firo_runner/coin_holder.dart'; import 'package:firo_runner/firework.dart'; import 'package:firo_runner/game_state.dart'; +import 'package:firo_runner/platform.dart'; import 'package:firo_runner/platform_holder.dart'; import 'package:firo_runner/wire.dart'; import 'package:firo_runner/wire_holder.dart'; @@ -203,6 +204,8 @@ class MyGame extends BaseGame with PanDetector, TapDetector, KeyboardEvents { runner.setUp(); fillScreen(); + platformHolder.platforms[2][0].sprite.current = PlatformState.left; + platformHolder.platforms[5][0].sprite.current = PlatformState.left; } @override diff --git a/lib/platform.dart b/lib/platform.dart index 9690261..af000ef 100644 --- a/lib/platform.dart +++ b/lib/platform.dart @@ -99,7 +99,7 @@ class Platform extends MovingObject { right = platformLevel.elementAt(index + 1).sprite.position; } super.update(dt); - if (index == -1 || sprite.position.x <= 0) { + if (index == -1 || (index < 1 && sprite.x <= sprite.width)) { return; } Vector2 left = Vector2(-200, -200); diff --git a/lib/runner.dart b/lib/runner.dart index bbde8fd..c84e1a9 100644 --- a/lib/runner.dart +++ b/lib/runner.dart @@ -239,6 +239,13 @@ class Runner extends Component with HasGameRef { event("kick"); } break; + case "left": + if (runnerState == "kick") { + sprite.animation!.reset(); + sprite.clearEffects(); + event("run"); + } + break; case "center": // if (runnerState == "fall") { // updateLevel(); @@ -367,8 +374,6 @@ class Runner extends Component with HasGameRef { } } else if (intersectState == "left" && runnerState == "kick") { bugLevel[i].sprite.current = BugState.breaking; - // bugLevel[i].remove(); - // bugLevel.removeAt(i); } else { event("glitch"); return; @@ -416,8 +421,8 @@ class Runner extends Component with HasGameRef { SpriteAnimation kicking = await loadSpriteAnimation( 'kick-frames.png', SpriteAnimationData.sequenced( - amount: 13, - stepTime: 0.05, + amount: 19, + stepTime: 0.03, textureSize: Vector2(512, 512), loop: false, ),