Allow transition to ladder only on climbing up
parent
b8fc099ced
commit
707ab692a1
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue