[FIX] Bol i escena del bol
This commit is contained in:
32
data/bol.lua
32
data/bol.lua
@@ -6,7 +6,14 @@ bol_gif_col = 14
|
|||||||
bol_gif_row = 3
|
bol_gif_row = 3
|
||||||
|
|
||||||
-- bol={hab=39,x=28,y=25,w=32,h=16,bb={x=0,y=0,w=16,h=8}}
|
-- bol={hab=39,x=28,y=25,w=32,h=16,bb={x=0,y=0,w=16,h=8}}
|
||||||
bol={hab=39,x=4,y=3,w=32,h=16,bb={x=0,y=0,w=16,h=8}}
|
bol={
|
||||||
|
hab=39,
|
||||||
|
x=4, y=3,
|
||||||
|
w=32,h=16,
|
||||||
|
bb={x=0,y=0,w=16,h=8},
|
||||||
|
furtat = false,
|
||||||
|
scene_trobat = false,
|
||||||
|
}
|
||||||
|
|
||||||
function bol.init()
|
function bol.init()
|
||||||
local world_x, world_y = coords.room_to_world(bol.hab,bol.x,bol.y)
|
local world_x, world_y = coords.room_to_world(bol.hab,bol.x,bol.y)
|
||||||
@@ -26,7 +33,20 @@ function bol.draw()
|
|||||||
local x = bol_gif_col*tw
|
local x = bol_gif_col*tw
|
||||||
local y = toff+bol_gif_row*th
|
local y = toff+bol_gif_row*th
|
||||||
local scr_x, scr_y = viewp:screen_coords( bol.x, bol.y )
|
local scr_x, scr_y = viewp:screen_coords( bol.x, bol.y )
|
||||||
|
if bol.furtat then
|
||||||
|
pal.trans(0)
|
||||||
|
pal.subpal(1,0)
|
||||||
|
pal.subpal(2,0)
|
||||||
|
pal.subpal(5,0)
|
||||||
|
pal.subpal(6,2)
|
||||||
|
pal.subpal(16,2)
|
||||||
|
end
|
||||||
draw.surf(x,y,bol.w,bol.h,scr_x,scr_y,bol.w,bol.h)
|
draw.surf(x,y,bol.w,bol.h,scr_x,scr_y,bol.w,bol.h)
|
||||||
|
pal.subpal(1)
|
||||||
|
pal.subpal(2)
|
||||||
|
pal.subpal(5)
|
||||||
|
pal.subpal(6)
|
||||||
|
pal.subpal(16)
|
||||||
end
|
end
|
||||||
|
|
||||||
function bol.update()
|
function bol.update()
|
||||||
@@ -37,4 +57,14 @@ function bol.update()
|
|||||||
-- remove_actor(bol)
|
-- remove_actor(bol)
|
||||||
-- end
|
-- end
|
||||||
-- end
|
-- end
|
||||||
|
local ah,ax,ay = coords.world_to_tile(abad.x, abad.y)
|
||||||
|
local bh,bx,by = coords.world_to_tile(bol.x, bol.y)
|
||||||
|
if bh ==ah then
|
||||||
|
if ay==by and not bol.scene_trobat then
|
||||||
|
-- abad.objects.bol=true
|
||||||
|
start_scene(scenes.bol_trobat)
|
||||||
|
bol.scene_trobat = true
|
||||||
|
-- remove_actor(bol)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -270,10 +270,10 @@ function imp:update_normal()
|
|||||||
|
|
||||||
-- Logica per a selecció de frame
|
-- Logica per a selecció de frame
|
||||||
self:next_frame()
|
self:next_frame()
|
||||||
end
|
|
||||||
|
|
||||||
-- colisions en personatges
|
-- colisions en personatges
|
||||||
-- self:colisions()
|
-- self:colisions()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
require "imp3-functions"
|
require "imp3-functions"
|
||||||
@@ -148,10 +148,15 @@ scenes={
|
|||||||
{x=avatar_abad2_x,y=avatar_abad_y,flip=false,audio="abad",text={"L'habitació de Batman!","Segur que els cacaus","estàn ahí dins."}},
|
{x=avatar_abad2_x,y=avatar_abad_y,flip=false,audio="abad",text={"L'habitació de Batman!","Segur que els cacaus","estàn ahí dins."}},
|
||||||
{x=avatar_abad2_x,y=avatar_abad_y,flip=false,audio="abad",text={"Però necessite","una clau...",""}}
|
{x=avatar_abad2_x,y=avatar_abad_y,flip=false,audio="abad",text={"Però necessite","una clau...",""}}
|
||||||
},
|
},
|
||||||
|
-- bol_trobat={
|
||||||
|
-- {x=avatar_abad2_x,y=avatar_abad_y,flip=false,audio="abad",text={"PER FI, JA TINC","ELS MEUS CACAUS!!!","OLE!! OLE!!"}},
|
||||||
|
-- {x=avatar_abad2_x,y=avatar_abad_y,flip=false,audio="abad",text={"Se va a enterar","Batman ara quan","el pille..."}},
|
||||||
|
-- {x=avatar_abad2_x,y=avatar_abad_y,flip=false,audio="abad",text={"Ara si que li puc","pegar una bona","cacauà..."}}
|
||||||
|
-- },
|
||||||
bol_trobat={
|
bol_trobat={
|
||||||
{x=avatar_abad2_x,y=avatar_abad_y,flip=false,audio="abad",text={"PER FI, JA TINC","ELS MEUS CACAUS!!!","OLE!! OLE!!"}},
|
{x=avatar_abad2_x,y=avatar_abad_y,flip=false,audio="abad",text={"EH! ON ESTAN","ELS MEUS CACAUS!!?",""}},
|
||||||
{x=avatar_abad2_x,y=avatar_abad_y,flip=false,audio="abad",text={"Se va a enterar","Batman ara quan","el pille..."}},
|
{x=avatar_abad2_x,y=avatar_abad_y,flip=false,audio="abad",text={"Se va a enterar","Batman en quan","el pille..."}},
|
||||||
{x=avatar_abad2_x,y=avatar_abad_y,flip=false,audio="abad",text={"Ara si que li puc","pegar una bona","cacauà..."}}
|
{x=avatar_abad2_x,y=avatar_abad_y,flip=false,audio="abad",text={"...","I eixe soroll?","..."}}
|
||||||
},
|
},
|
||||||
final= {
|
final= {
|
||||||
{x=avatar_batman_x,y=avatar_batman_y,flip=true,audio="batman",musica=audio_song_batman,text={"AI!", "M'has fet mal!!!",""},die=20},
|
{x=avatar_batman_x,y=avatar_batman_y,flip=true,audio="batman",musica=audio_song_batman,text={"AI!", "M'has fet mal!!!",""},die=20},
|
||||||
|
|||||||
@@ -141,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 ( 19, 1, 3 )
|
||||||
|
|
||||||
abad:move(abad_x, abad_y)
|
abad:move(abad_x, abad_y)
|
||||||
abad_make_safe( true )
|
abad_make_safe( true )
|
||||||
|
|||||||
@@ -118,11 +118,13 @@ 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 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})
|
local trigger = trigger.new(abad.hab,1,1,nil,"","porta acces cacaus","",{20, 53,41})
|
||||||
trigger:open_door()
|
trigger:open_door()
|
||||||
|
bol.furtat=true
|
||||||
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user