Files
cacaus-arcade/data/batvio.lua
T
JailGamer 45ea1b33bf [FIX] Canviat el nom de flow a states que es mes precis
[FIX] Ajustada posició del peu en habitació 27
[FIX] Modificat trigger_event per a que es disparen en una habitació concreta i també segons distancia sense haver de colisionar
[FIX] Ending stage 1
[FIX] ELiminades llunes duplicades
[NEW] Dialeg per a l'abad
2026-05-10 14:08:11 +02:00

73 lines
1.5 KiB
Lua

-- 0,80 -> 112,112
batvio={
name="batvio",
hab=7,
x=9,
y=2,
w=112,
h=32,
flip=true,
frame=0,
wait=0,
step=0,
energy=_energy,
max_energy = _energy,
hit=zombie.hit,
update=zombie.update_normal,
draw=zombie.draw,
jumpfwd=false,
anim={},
bb={x=16,y=3,w=80,h=29},
can_warp=false,
warping=false,
shrink=1,
d_shrink=1,
angle=0,
d_angle=15,
dying=false,
death_time=40,
enabled=false,
disable_reason="",
}
function batvio.init()
local world_x, world_y = coords.room_to_world(batvio.hab,batvio.x,batvio.y)
batvio.x=world_x
batvio.y=world_y
end
function batvio.draw()
if not batvio.enabled then return end
local curr_sf = surf.source()
surf.source(tiles2)
local scr_x, scr_y = viewp:screen_coords( batvio.x, batvio.y )
local motor_pos = scr_x
local cabina_pos = scr_x+32
if batvio.flip then
motor_pos = scr_x + batvio.w-32
cabina_pos = scr_x
end
-- foc del propulsor
if batvio.step % 2 == 0 then
pal.subpal(3,0)
pal.subpal(7,0)
pal.subpal(8,0)
end
draw.surf(0,80,32,batvio.h,motor_pos,scr_y,32,batvio.h,batvio.flip)
pal.subpal(3)
pal.subpal(7)
pal.subpal(8)
-- resta de l'avio
draw.surf(32,80,batvio.w-32,batvio.h,cabina_pos,scr_y,batvio.w-32,batvio.h,batvio.flip)
surf.source(curr_sf)
end
function batvio.hit()
end
function batvio.update()
if not batvio.enabled then return end
batvio.step = batvio.step +1
end