Files
cacaus-arcade/data/invisible.lua
JailGamer 205586cc77 [WIP] Afegint codi per a múltiples fases
[NEW] Quan cau la gota canvia la imatge. Ja no cauen peres XD
[FIX] El foc feia mal des de massa alt
2026-04-04 17:00:43 +02:00

47 lines
1.0 KiB
Lua

invisible={}
function invisible.new(_hab,_x,_y)
local world_x, world_y = coords.room_to_world(_hab,_x,_y)
return {hab=_hab,
x=world_x,
y=world_y,
w=16,
h=16,
wait=0,
hit=invisible.hit,
update=invisible.update,
draw=invisible.draw,
bb={x=0,y=1,w=16,h=15}}
end
function invisible:draw()
-- Es invisible, res que drawar
-- local scr_x, scr_y = viewp:screen_coords( self.x+self.bb.x, self.y+self.bb.y )
-- draw.rect(scr_x, scr_y, 16, 16, 3)
end
function invisible:update()
--self.wait=self.wait+1
--
--if self.wait==6 then
-- self.wait=0
--
-- if self.hab==abad.hab then
-- if aabb(abad,self) then
-- abad_hurt(1)
-- end
-- end
--
--end
if viewp:inside(self.x, self.y, self.w, self.h) then
if collision(abad,self) then
print("check collision")
abad_hurt(1)
end
end
end
function invisible:hit()
end