Clipping improvement

This commit is contained in:
KikooDX 2021-01-13 14:23:34 +01:00
parent d00fa96a9d
commit 6595a27503
1 changed files with 2 additions and 1 deletions

View File

@ -84,7 +84,8 @@ void player_move(Player *player, const Level *level) {
if (PLAYER_COLLIDE_SOLID(destination)) {
/* Used for clipping and positionning. */
int offset = destination.y % TILE_SIZE;
if (offset > H_CLIP_MARGIN) {
/* If player is rising or offset is too high then don't clip. */
if (player->spd.y < 0 || offset > H_CLIP_MARGIN) {
offset = 0;
}
destination.y -= offset;