Clipping improvement
This commit is contained in:
parent
d00fa96a9d
commit
6595a27503
|
@ -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;
|
||||
|
|
Reference in New Issue