diff --git a/data/batvio.lua b/data/batvio.lua new file mode 100644 index 0000000..a859059 --- /dev/null +++ b/data/batvio.lua @@ -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 \ No newline at end of file diff --git a/data/bol.lua b/data/bol.lua index 1580c3e..fb04bb8 100644 --- a/data/bol.lua +++ b/data/bol.lua @@ -65,6 +65,8 @@ function bol.update() start_scene(scenes.bol_trobat) bol.scene_trobat = true -- 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 diff --git a/data/game.lua b/data/game.lua index 7fefcef..7868967 100644 --- a/data/game.lua +++ b/data/game.lua @@ -26,6 +26,7 @@ require "trigger_event" require "batman" require "health_potion" require "tiles_layer2" +require "batvio" local DEBUG = false @@ -287,9 +288,9 @@ function update_game() score.draw() - if DEBUG then special_keys() debug_info() + if DEBUG then end end diff --git a/data/main.lua b/data/main.lua index 16d9819..d3f6a6b 100644 --- a/data/main.lua +++ b/data/main.lua @@ -37,7 +37,7 @@ function images_init() surf.source(tiles) local paleta=pal.load("tiles.gif") pal.set(paleta) - + tiles2=surf.load("tiles2.gif") -- Crear el warp warp.init(tiles) end diff --git a/data/pattern.lua b/data/pattern.lua index afc60b3..94b33be 100644 --- a/data/pattern.lua +++ b/data/pattern.lua @@ -49,7 +49,7 @@ function pattern:noop() end function pattern:draw() - if true then return end + -- if true then return end local scr_x = 0 local scr_y = 0 local target = self:target() diff --git a/data/stage1.lua b/data/stage1.lua index b1197ee..0713fb4 100644 --- a/data/stage1.lua +++ b/data/stage1.lua @@ -27,6 +27,9 @@ function stages.stage1_init() elalien.init() table.insert(actors,elalien) + batvio.init() + table.insert(actors,batvio) + boss = imp.new(55,4,3) table.insert( actors, boss ) 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 ( 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_make_safe( true ) diff --git a/data/tiles2.gif b/data/tiles2.gif new file mode 100644 index 0000000..03a342e Binary files /dev/null and b/data/tiles2.gif differ diff --git a/data/trigger.lua b/data/trigger.lua index 54f6b43..7902e6e 100644 --- a/data/trigger.lua +++ b/data/trigger.lua @@ -124,8 +124,8 @@ function triggers:escena_abad_porta_batman() end function triggers:escena_habitacio_batman() - if abad.objects.clau_premiere~=nil and - abad.objects.clau_elalien~=nil + if abad.objects.clau_premiere==nil and + abad.objects.clau_elalien==nil then -- switches.start(0,0) 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 +function triggers:escena_stage1_ending() + print("STAGE 1 ENDING") + remove_actor(self) +end + function triggers:escena_lluita_imp() 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)