[NEW] Batvió

[NEW] tiles2.gif
This commit is contained in:
2026-05-04 21:54:43 +02:00
parent 61bf843799
commit cb16e0ea63
8 changed files with 70 additions and 6 deletions

53
data/batvio.lua Normal file
View File

@@ -0,0 +1,53 @@
-- 0,80 -> 112,112
batvio={
name="batvio",
hab=7,
x=7,
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=true,
disable_reason="",
enabled=true,
}
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()
local curr_sf = surf.source()
surf.source(tiles2)
local scr_x, scr_y = viewp:screen_coords( batvio.x, batvio.y )
draw.surf(0,80,batvio.w,batvio.h,scr_x,scr_y,batvio.w,batvio.h,batvio.flip)
surf.source(curr_sf)
end
function batvio.hit()
end
function batvio.update()
end

View File

@@ -65,6 +65,8 @@ function bol.update()
start_scene(scenes.bol_trobat) start_scene(scenes.bol_trobat)
bol.scene_trobat = true bol.scene_trobat = true
-- remove_actor(bol) -- remove_actor(bol)
-- crear el trigger per a disparar el final de fase
table.insert( actors, trigger.new(8,4,3,triggers.escena_stage1_ending,"stage1 ending","TR09") )
end end
end end
end end

View File

@@ -26,6 +26,7 @@ require "trigger_event"
require "batman" require "batman"
require "health_potion" require "health_potion"
require "tiles_layer2" require "tiles_layer2"
require "batvio"
local DEBUG = false local DEBUG = false
@@ -287,9 +288,9 @@ function update_game()
score.draw() score.draw()
if DEBUG then
special_keys() special_keys()
debug_info() debug_info()
if DEBUG then
end end
end end

View File

@@ -37,7 +37,7 @@ function images_init()
surf.source(tiles) surf.source(tiles)
local paleta=pal.load("tiles.gif") local paleta=pal.load("tiles.gif")
pal.set(paleta) pal.set(paleta)
tiles2=surf.load("tiles2.gif")
-- Crear el warp -- Crear el warp
warp.init(tiles) warp.init(tiles)
end end

View File

@@ -49,7 +49,7 @@ function pattern:noop()
end end
function pattern:draw() function pattern:draw()
if true then return end -- if true then return end
local scr_x = 0 local scr_x = 0
local scr_y = 0 local scr_y = 0
local target = self:target() local target = self:target()

View File

@@ -27,6 +27,9 @@ function stages.stage1_init()
elalien.init() elalien.init()
table.insert(actors,elalien) table.insert(actors,elalien)
batvio.init()
table.insert(actors,batvio)
boss = imp.new(55,4,3) boss = imp.new(55,4,3)
table.insert( actors, boss ) table.insert( actors, boss )
boss_meter = bar_meter.new(20,12,128,10,1,1,boss,5) boss_meter = bar_meter.new(20,12,128,10,1,1,boss,5)
@@ -164,7 +167,7 @@ function stages.stage1_init()
local abad_x, abad_y = coords.room_to_world ( 10, 4, 3 ) local abad_x, abad_y = coords.room_to_world ( 10, 4, 3 )
-- local abad_x, abad_y = coords.room_to_world ( 54, 8, 3 ) -- local abad_x, abad_y = coords.room_to_world ( 54, 8, 3 )
-- local abad_x, abad_y = coords.room_to_world ( 18, 9, 3 ) local abad_x, abad_y = coords.room_to_world ( 18, 9, 3 )
abad:move(abad_x, abad_y) abad:move(abad_x, abad_y)
abad_make_safe( true ) abad_make_safe( true )

BIN
data/tiles2.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@@ -124,8 +124,8 @@ function triggers:escena_abad_porta_batman()
end end
function triggers:escena_habitacio_batman() function triggers:escena_habitacio_batman()
if abad.objects.clau_premiere~=nil and if abad.objects.clau_premiere==nil and
abad.objects.clau_elalien~=nil abad.objects.clau_elalien==nil
then then
-- switches.start(0,0) -- switches.start(0,0)
local trigger_porta = trigger.new(abad.hab,1,1,triggers.open_door,"switch","porta acces cacaus","",{20, 53,41}) local trigger_porta = trigger.new(abad.hab,1,1,triggers.open_door,"switch","porta acces cacaus","",{20, 53,41})
@@ -142,6 +142,11 @@ function triggers:escena_habitacio_batman()
end end
end end
function triggers:escena_stage1_ending()
print("STAGE 1 ENDING")
remove_actor(self)
end
function triggers:escena_lluita_imp() function triggers:escena_lluita_imp()
set_actors_enabled_by_room(false, "boss", stage1_boss_mapa.r0.r, stage1_boss_mapa.r1.r) set_actors_enabled_by_room(false, "boss", stage1_boss_mapa.r0.r, stage1_boss_mapa.r1.r)
viewp:fixed({l=8,r=44,u=0,d=0}, viewp.x, viewp.y-48) viewp:fixed({l=8,r=44,u=0,d=0}, viewp.x, viewp.y-48)