[NEW] Porta final funcionant

[FIX] Una posició del peu
This commit is contained in:
2026-05-01 00:35:55 +02:00
parent 8e3117d5bc
commit df30835830
4 changed files with 11 additions and 6 deletions

View File

@@ -133,7 +133,7 @@ end
function abad_hurt(howmuch) function abad_hurt(howmuch)
-- howmuch = 0 howmuch = 0
if abad.hurting == 0 and abad.respawning==0 then if abad.hurting == 0 and abad.respawning==0 then
sound.play(audio_abad_hit) sound.play(audio_abad_hit)
abad.energia=abad.energia-howmuch abad.energia=abad.energia-howmuch

View File

@@ -11,7 +11,7 @@ peu={name="peu",hab=5,x=6,y=3,w=32,h=32,bb={x=0,y=0,w=16,h=16}}
function peu.init() function peu.init()
-- local habs={{18,8},{16,2},{16,7},{15,5},{27,1},{27,10},{29,2},{38,8},{69,2},{79,3}} -- local habs={{18,8},{16,2},{16,7},{15,5},{27,1},{27,10},{29,2},{38,8},{69,2},{79,3}}
local habs={{69,0},{78,5},{59,8},{27,8},{16,0},{18,8}} local habs={{69,0},{78,6},{59,8},{27,8},{16,0},{18,8}}
local r=1+math.random(0,#habs-1) local r=1+math.random(0,#habs-1)
peu.hab=habs[r][1] peu.hab=habs[r][1]
-- peu.x=habs[r][2]*8 -- peu.x=habs[r][2]*8

View File

@@ -103,7 +103,7 @@ function stages.stage1_init()
table.insert( actors, trigger.new(53,5,3,triggers.escena_abad_porta_casa,"porta casa","TR06")) table.insert( actors, trigger.new(53,5,3,triggers.escena_abad_porta_casa,"porta casa","TR06"))
table.insert( actors, trigger.new(56,4,3,triggers.escena_abad_porta_batman,"porta batman","TR07")) table.insert( actors, trigger.new(56,4,3,triggers.escena_abad_porta_batman,"porta batman","TR07"))
table.insert( actors, trigger.new(19,4,3,triggers.escena_habitacio_batman,"habitacio batman")) table.insert( actors, trigger.new(19,4,3,triggers.escena_habitacio_batman,"habitacio batman","TR08"))
-- --
table.insert( actors, trigger.new(55,1,3,triggers.escena_lluita_imp,"lluita imp")) table.insert( actors, trigger.new(55,1,3,triggers.escena_lluita_imp,"lluita imp"))
@@ -115,6 +115,7 @@ function stages.stage1_init()
table.insert( actors, trigger.new(75,9,1,triggers.open_door,"","acces inf casa batman","switch",{57, 53,41},{"TR07"}) ) table.insert( actors, trigger.new(75,9,1,triggers.open_door,"","acces inf casa batman","switch",{57, 53,41},{"TR07"}) )
table.insert( actors, trigger.new(79,5,1,triggers.open_door,"","sotan casa batman","switch",{36, 56,44}) ) table.insert( actors, trigger.new(79,5,1,triggers.open_door,"","sotan casa batman","switch",{36, 56,44}) )
table.insert( actors, trigger.new(38,2,2,triggers.open_door,"","","switch",{39, 62,63}) ) table.insert( actors, trigger.new(38,2,2,triggers.open_door,"","","switch",{39, 62,63}) )
-- table.insert( actors, trigger.new(1, 1,1,triggers.open_door,"","acces cacaus","switch",{20, 53,41},{"TR08"}))
-- table.insert(actors,trigger.new(14,40,32,triggers.teleport_a)) -- table.insert(actors,trigger.new(14,40,32,triggers.teleport_a))
-- table.insert(actors,trigger.new(67,8,32,triggers.teleport_b)) -- table.insert(actors,trigger.new(67,8,32,triggers.teleport_b))
@@ -140,7 +141,7 @@ function stages.stage1_init()
zombie2, abad, 150, "Aaaaaargh... per ell!", 250) zombie2, abad, 150, "Aaaaaargh... per ell!", 250)
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 ( 9, 4, 3 ) -- local abad_x, abad_y = coords.room_to_world ( 9, 4, 3 )
abad:move(abad_x, abad_y) abad:move(abad_x, abad_y)
abad_make_safe( true ) abad_make_safe( true )

View File

@@ -23,7 +23,8 @@ function trigger.new(_hab,_x,_y,_action,_escena,_id,_type,_doors,_linked_id)
linked_id=_linked_id, linked_id=_linked_id,
enabled=true, enabled=true,
disable_reason="", disable_reason="",
bb=_bb } bb=_bb,
open_door=triggers.open_door }
end end
function trigger:update() function trigger:update()
@@ -118,7 +119,10 @@ end
function triggers:escena_habitacio_batman() function triggers:escena_habitacio_batman()
if abad.objects.clau_premiere~=nil and abad.objects.clau_elalien~=nil then if abad.objects.clau_premiere~=nil and abad.objects.clau_elalien~=nil then
switches.start(0,0) -- switches.start(0,0)
local trigger = trigger.new(abad.hab,1,1,nil,"","porta acces cacaus","",{20, 53,41})
trigger:open_door()
abad.objects.clau_premiere=nil abad.objects.clau_premiere=nil
abad.objects.clau_elalien=nil abad.objects.clau_elalien=nil
remove_actor(self) remove_actor(self)