Compare commits

..

No commits in common. "707ab692a137b6080455ae45c887be9d01f6fd53" and "bc0f7617d457398777d9315ed8c07df7ba6708e7" have entirely different histories.

1 changed files with 26 additions and 31 deletions

View File

@ -343,32 +343,32 @@ void player_movement_input_system(Scene_t* scene)
p_player->position.y--; p_player->position.y--;
} }
} }
//else if (p_pstate->player_dir.y > 0) else if (p_pstate->player_dir.y > 0)
//{ {
// unsigned int tile_idx; unsigned int tile_idx;
// if (p_mstate->ground_state & 1) if (p_mstate->ground_state & 1)
// { {
// tile_idx = get_tile_idx( tile_idx = get_tile_idx(
// p_player->position.x + p_bbox->half_size.x, p_player->position.x + p_bbox->half_size.x,
// p_player->position.y + p_bbox->size.y, p_player->position.y + p_bbox->size.y,
// data->tilemap data->tilemap
// ); );
// } }
// else else
// { {
// tile_idx = get_tile_idx( tile_idx = get_tile_idx(
// p_player->position.x + p_bbox->half_size.x, p_player->position.x + p_bbox->half_size.x,
// p_player->position.y + p_bbox->half_size.y, p_player->position.y + p_bbox->half_size.y,
// data->tilemap data->tilemap
// ); );
// } }
// if (tile_idx < tilemap.n_tiles && tilemap.tiles[tile_idx].tile_type == LADDER) if (tile_idx < tilemap.n_tiles && tilemap.tiles[tile_idx].tile_type == LADDER)
// { {
// p_pstate->ladder_state = true; p_pstate->ladder_state = true;
// p_player->position.y++; p_player->position.y++;
// } }
//} }
} }
} }
else else
@ -1408,10 +1408,6 @@ void player_ground_air_transition_system(Scene_t* scene)
// Handle Ground<->Air Transition // Handle Ground<->Air Transition
bool in_water = (p_mstate->water_state & 1); bool in_water = (p_mstate->water_state & 1);
bool jump_recover_cond = (p_mstate->ground_state & 1 || in_water || p_pstate->ladder_state); bool jump_recover_cond = (p_mstate->ground_state & 1 || in_water || p_pstate->ladder_state);
// There is this odd state that can happen, so deal with it
if(!p_cjump->jump_released && !p_pstate->jump_pressed) p_cjump->jump_released = true;
// Landing or in water // Landing or in water
if (p_mstate->water_state == 0b10 || p_mstate->ground_state == 0b10) if (p_mstate->water_state == 0b10 || p_mstate->ground_state == 0b10)
{ {
@ -1422,6 +1418,7 @@ void player_ground_air_transition_system(Scene_t* scene)
// Recover jumps // Recover jumps
p_cjump->jumps = p_cjump->max_jumps; p_cjump->jumps = p_cjump->max_jumps;
p_cjump->jumped = false; p_cjump->jumped = false;
if(!p_cjump->jump_released && !p_pstate->jump_pressed) p_cjump->jump_released = true;
p_cjump->short_hop = false; p_cjump->short_hop = false;
p_cjump->jump_ready = true; p_cjump->jump_ready = true;
p_cjump->coyote_timer = 0; p_cjump->coyote_timer = 0;
@ -1717,8 +1714,6 @@ void hitbox_update_system(Scene_t* scene)
// Don't allow the usual jump interaction with crate jump // Don't allow the usual jump interaction with crate jump
p_cjump->short_hop = true; p_cjump->short_hop = true;
p_cjump->jumped = false; p_cjump->jumped = false;
p_cjump->jump_released = false;
p_pstate->jump_pressed = true;
p_ctransform->velocity.y = -400; p_ctransform->velocity.y = -400;
if (p_pstate->jump_pressed) if (p_pstate->jump_pressed)