Reenable jumping and tone it down

master
En Yi 2020-02-22 19:47:05 +08:00
parent eeccd7c70e
commit e8dbdc68b3
1 changed files with 11 additions and 12 deletions

View File

@ -4,10 +4,10 @@
#define PLAYER_ACCEL 1600 #define PLAYER_ACCEL 1600
#define AIR_ACCEL 800 #define AIR_ACCEL 800
#define RUN_INIT_SPD 230 #define RUN_INIT_SPD 230
#define JUMP_SPD 500 #define JUMP_SPD 350
#define GRAV 1200 #define GRAV 1200
#define DASH_SPD 550 #define DASH_SPD 550
#define DEFAULT_JUMP_COUNT 0 #define DEFAULT_JUMP_COUNT 1
static bool allow_move = true; static bool allow_move = true;
static bool allow_friction = true; static bool allow_friction = true;
@ -174,17 +174,16 @@ void player_input_check(struct player_obj *player){
} }
if(frame_counter<land_lag_frames){ if(frame_counter<land_lag_frames){
++frame_counter; ++frame_counter;
//if (IsKeyDown(JUMP)) if (IsKeyDown(JUMP))
// state_buffer = JUMP_SQUAT; state_buffer = JUMP_SQUAT;
} }
else{ else{
jumps = DEFAULT_JUMP_COUNT;
frame_counter = 0; frame_counter = 0;
//if (state_buffer == JUMP_SQUAT){ jumps = DEFAULT_JUMP_COUNT;
// player->state = state_buffer; if (state_buffer == JUMP_SQUAT){
// --jumps; player->state = state_buffer;
//} --jumps;
if (IsKeyDown(LEFT) || IsKeyDown(RIGHT)) }else if (IsKeyDown(LEFT) || IsKeyDown(RIGHT))
player->state = RUNNING; player->state = RUNNING;
else else
player->state = IDLE; player->state = IDLE;
@ -300,11 +299,11 @@ void player_input_check(struct player_obj *player){
move(&player->kinematic, accel); move(&player->kinematic, accel);
// Handle jumping // Handle jumping
/*if (IsKeyPressed(JUMP) && jumps > 0){ if (IsKeyPressed(JUMP) && jumps > 0){
player->state = JUMP_SQUAT; player->state = JUMP_SQUAT;
short_hop = false; short_hop = false;
--jumps; --jumps;
}*/ }
// Deform player based on falling speed // Deform player based on falling speed
player->kinematic.set_dim_reduction[1] = 0; player->kinematic.set_dim_reduction[1] = 0;