From 5cc80ec58ea5bd66456f6f5286fa5f26d3fe702b Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Mon, 12 Feb 2018 16:39:49 -0500 Subject: Abstracted behavior related to "orientable" entities A lot of the stuff that ControllingSystem did to control the player character was moved into the new OrientingSystem. This is so that the player, or any player-like entities, can also be controlled by AI, with the underlying behavior being delegated in the same way as if the player were being controlled by the user. Fixed the issue where, if the player were blocked while moving horizontally, they would remain blocked even if vertical movement were to remove the collision. Fixed cases of the player animating incorrectly after performing certain movements. --- src/consts.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/consts.h') diff --git a/src/consts.h b/src/consts.h index a6c9985..581018d 100644 --- a/src/consts.h +++ b/src/consts.h @@ -14,7 +14,13 @@ const int FONT_COLS = 16; const int FRAMES_PER_SECOND = 60; const double SECONDS_PER_FRAME = 1.0 / FRAMES_PER_SECOND; -#define JUMP_VELOCITY(h, l) (-2 * (h) / (l)) -#define JUMP_GRAVITY(h, l) (2 * ((h) / (l)) / (l)) +#define CALC_VELOCITY(h, l) (-2 * (h) / (l)) +#define CALC_GRAVITY(h, l) (2 * ((h) / (l)) / (l)) + +const double NORMAL_GRAVITY = CALC_GRAVITY(TILE_HEIGHT*3.5, 0.233); +const double JUMP_GRAVITY = CALC_GRAVITY(TILE_HEIGHT*4.5, 0.3); +const double JUMP_VELOCITY = CALC_VELOCITY(TILE_HEIGHT*4.5, 0.3); + +const double WALK_SPEED = 90; #endif -- cgit 1.4.1