aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authornathansmith117 <thenathansmithsmith@gmail.com>2024-05-06 21:34:38 +0000
committernathansmith117 <thenathansmithsmith@gmail.com>2024-05-06 21:34:38 +0000
commit2e90f9f959b0fcefbea728a00dda8c1cfed222fb (patch)
tree22d3d6004edbd0ffa5a6de4dec027babd57cceab /src
parente9787dccd1cc1f0ef096ecde381f9f817a86260a (diff)
downloadPenguinYippies-2e90f9f959b0fcefbea728a00dda8c1cfed222fb.tar.gz
PenguinYippies-2e90f9f959b0fcefbea728a00dda8c1cfed222fb.tar.bz2
PenguinYippies-2e90f9f959b0fcefbea728a00dda8c1cfed222fb.zip
Jumping is different
Diffstat (limited to 'src')
-rw-r--r--src/shooterScreen.c4
-rw-r--r--src/shooterScreen.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/shooterScreen.c b/src/shooterScreen.c
index 6b1322d..b3adb53 100644
--- a/src/shooterScreen.c
+++ b/src/shooterScreen.c
@@ -80,9 +80,9 @@ void updateShooterScreenJump(ShooterScreen* shooterScreen, Game* game)
case 0: // No Jumpy
break;
case 1: // Jump up
- player->velocity.y = PLAYER_JUMP_SPEED;
+ player->velocity.y = PLAYER_JUMP_SPEED * pow(((PLAYER_JUMP_HEIGHT + PLAYER_HEIGHT) - player->position.y), 2.0);
- if (player->position.y >= PLAYER_JUMP_HEIGHT + PLAYER_HEIGHT)
+ if ((int)player->velocity.y == 0)
{
player->jumpStage = 2;
}
diff --git a/src/shooterScreen.h b/src/shooterScreen.h
index 720b961..f077ee6 100644
--- a/src/shooterScreen.h
+++ b/src/shooterScreen.h
@@ -7,8 +7,8 @@
#define PLAYER_HEIGHT 2.0
#define PLAYER_SPEED 10.0
-#define PLAYER_JUMP_SPEED 15.0
-#define PLAYER_FALL_SPEED 18.0
+#define PLAYER_JUMP_SPEED 20.0
+#define PLAYER_FALL_SPEED 20.0
#define PLAYER_JUMP_HEIGHT 8.0
#define MOUSE_SPEED 0.01