Allow entities to mostly go offscreen, but not enough to let the player cut across the level.
This commit is contained in:
parent
537f3c42ff
commit
befea2ac65
|
@ -435,7 +435,7 @@ static void moveEntity(void)
|
||||||
if (!(self->flags & (EF_KILL_OFFSCREEN | EF_NO_CLIP)))
|
if (!(self->flags & (EF_KILL_OFFSCREEN | EF_NO_CLIP)))
|
||||||
{
|
{
|
||||||
self->x = limit(self->x, world.map.bounds.x, world.map.bounds.w + SCREEN_WIDTH - self->w);
|
self->x = limit(self->x, world.map.bounds.x, world.map.bounds.w + SCREEN_WIDTH - self->w);
|
||||||
self->y = limit(self->y, world.map.bounds.y, world.map.bounds.h + SCREEN_HEIGHT - self->h);
|
self->y = limit(self->y, world.map.bounds.y - (self->h - 1), world.map.bounds.h + SCREEN_HEIGHT - self->h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue