kill player offscreen

This commit is contained in:
yuki 2025-11-11 23:20:52 -03:00
parent 8be9c21ba2
commit 7e24a44617

View file

@ -53,6 +53,12 @@ function Player:update(dt)
-- move collision area
self.collider:moveTo(self.x, self.y)
-- offscreen kill
if self.x < 0-self.w then self:kill() end
if self.y < 0-self.h then self:kill() end
if self.x > gw+self.w then self:kill() end
if self.y > gh+self.h then self:kill() end
if input:pressed('f11') then self:kill() end
end