Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
fix: player jumping when in ground (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcossevilla authored Oct 19, 2023
1 parent f747d6c commit 7772c7e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class PlayerKeyboardControllerBehavior extends Behavior<Player> {

if (parent.isAlive) {
// Keep jumping if started.
if (parent.jumping && parent.input.isPressed) {
if (parent.jumping && parent.input.isPressed && parent.isOnGround) {
parent.jumping = true;
} else {
parent.jumping = false;
Expand Down
4 changes: 2 additions & 2 deletions lib/game/components/player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ class Player extends JumperCharacter<DashRunGame> {

input = gameRef.input;
size = Vector2.all(gameRef.tileSize);
walkSpeed = gameRef.tileSize * 7;
minJumpImpulse = world.gravity * 0.6;
walkSpeed = gameRef.tileSize * 5;
minJumpImpulse = world.gravity * 0.7;
cameraAnchor = PlayerCameraAnchor();

add(cameraAnchor);
Expand Down

0 comments on commit 7772c7e

Please sign in to comment.