- [NEW] Invisible actor
- [NEW] Cacaus bowl - [NEW] Bowl found scene - [NEW] Batman kills on touch - [NEW] Drops and invisibles everywhere - Changed Batman room
This commit is contained in:
@@ -17,6 +17,9 @@ function batman.draw()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function batman.hit()
|
function batman.hit()
|
||||||
|
if abad.objects.bol~=nil then
|
||||||
|
-- Start end of the game
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function batman.update_normal()
|
function batman.update_normal()
|
||||||
@@ -116,7 +119,7 @@ function batman.update_normal()
|
|||||||
|
|
||||||
if batman.hab==abad.hab then
|
if batman.hab==abad.hab then
|
||||||
if aabb(abad,batman) then
|
if aabb(abad,batman) then
|
||||||
|
abad_hurt(40)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
20
bol.lua
Normal file
20
bol.lua
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
bol={hab=39,x=28,y=25,bb={x=0,y=0,w=16,h=8}}
|
||||||
|
|
||||||
|
function bol.init()
|
||||||
|
bol.update=bol.update
|
||||||
|
bol.draw=bol.draw
|
||||||
|
end
|
||||||
|
|
||||||
|
function bol.draw()
|
||||||
|
sspr(112,88,16,8,bol.x,bol.y,16,8)
|
||||||
|
end
|
||||||
|
|
||||||
|
function bol.update()
|
||||||
|
if bol.hab==abad.hab then
|
||||||
|
if aabb(abad,bol) then
|
||||||
|
abad.objects.bol=true
|
||||||
|
start_scene(scenes.bol_trobat)
|
||||||
|
remove_actor(bol)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
2
game.ini
2
game.ini
@@ -2,4 +2,4 @@ title=Cacaus
|
|||||||
width=128
|
width=128
|
||||||
height=96
|
height=96
|
||||||
zoom=5
|
zoom=5
|
||||||
files=dead.lua,scenes.lua,trigger.lua,score.lua,switches.lua,map.lua,mapa.lua,gota.lua,fireball.lua,cacau.lua,bambolla.lua,imp.lua,gps.lua,peu.lua,gorro.lua,batman.lua,elalien.lua,premiere.lua,caco.lua,zombie.lua,abad.lua,main.lua
|
files=dead.lua,scenes.lua,trigger.lua,score.lua,switches.lua,map.lua,mapa.lua,bol.lua,invisible.lua,gota.lua,fireball.lua,cacau.lua,bambolla.lua,imp.lua,gps.lua,peu.lua,gorro.lua,batman.lua,elalien.lua,premiere.lua,caco.lua,zombie.lua,abad.lua,main.lua
|
||||||
|
|||||||
27
invisible.lua
Normal file
27
invisible.lua
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
invisible={}
|
||||||
|
|
||||||
|
function invisible.new(_hab,_x,_y)
|
||||||
|
return {hab=_hab,x=_x,y=_y,wait=0,hit=invisible.hit,update=invisible.update,draw=invisible.draw,bb={x=0,y=0,w=8,h=8}}
|
||||||
|
end
|
||||||
|
|
||||||
|
function invisible:draw()
|
||||||
|
-- Es invisible, res que drawar
|
||||||
|
end
|
||||||
|
|
||||||
|
function invisible:update()
|
||||||
|
self.wait=self.wait+1
|
||||||
|
|
||||||
|
if self.wait==6 then
|
||||||
|
self.wait=0
|
||||||
|
|
||||||
|
if self.hab==abad.hab then
|
||||||
|
if aabb(abad,self) then
|
||||||
|
abad_hurt(1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function invisible:hit()
|
||||||
|
end
|
||||||
31
main.lua
31
main.lua
@@ -51,8 +51,27 @@ function _init()
|
|||||||
batman.init()
|
batman.init()
|
||||||
table.insert(actors,batman)
|
table.insert(actors,batman)
|
||||||
|
|
||||||
|
bol.init()
|
||||||
|
table.insert(actors,bol)
|
||||||
|
|
||||||
-- MALOTES PERSISTENTS
|
-- MALOTES PERSISTENTS
|
||||||
table.insert(actors,gota.new(10,80,4,20))
|
table.insert(actors,gota.new(70,40,8,20))
|
||||||
|
table.insert(actors,gota.new(70,72,8,30))
|
||||||
|
table.insert(actors,gota.new(63,40,4,25))
|
||||||
|
table.insert(actors,gota.new(63,72,4,20))
|
||||||
|
table.insert(actors,gota.new(64,24,4,10))
|
||||||
|
table.insert(actors,gota.new(64,56,4,25))
|
||||||
|
table.insert(actors,gota.new(65,24,4,10))
|
||||||
|
table.insert(actors,gota.new(65,64,4,25))
|
||||||
|
table.insert(actors,gota.new(66,24,4,10))
|
||||||
|
table.insert(actors,gota.new(66,32,4,15))
|
||||||
|
table.insert(actors,gota.new(77,16,4,30))
|
||||||
|
table.insert(actors,gota.new(77,72,4,25))
|
||||||
|
|
||||||
|
table.insert(actors,invisible.new(77,40,32))
|
||||||
|
table.insert(actors,invisible.new(77,48,32))
|
||||||
|
table.insert(actors,invisible.new(58,16,32))
|
||||||
|
table.insert(actors,invisible.new(58,16,32))
|
||||||
|
|
||||||
table.insert(actors,zombie.new(2,24,24,false))
|
table.insert(actors,zombie.new(2,24,24,false))
|
||||||
table.insert(actors,caco.new(13,24,16,true))
|
table.insert(actors,caco.new(13,24,16,true))
|
||||||
@@ -239,9 +258,19 @@ function update_game()
|
|||||||
fireball.update()
|
fireball.update()
|
||||||
switches.update()
|
switches.update()
|
||||||
|
|
||||||
|
local hx = abad.hab%10
|
||||||
|
local hy = flr(abad.hab/10)
|
||||||
if btnp(KEY_RETURN) then
|
if btnp(KEY_RETURN) then
|
||||||
mode=modes.editing
|
mode=modes.editing
|
||||||
mapa_restore_backup()
|
mapa_restore_backup()
|
||||||
|
elseif btn(KEY_LSHIFT) and btnp(KEY_RIGHT) and hx<9 then
|
||||||
|
abad.hab=abad.hab+1
|
||||||
|
elseif btn(KEY_LSHIFT) and btnp(KEY_LEFT) and hx>0 then
|
||||||
|
abad.hab=abad.hab-1
|
||||||
|
elseif btn(KEY_LSHIFT) and btnp(KEY_DOWN) and hy<7 then
|
||||||
|
abad.hab=abad.hab+10
|
||||||
|
elseif btn(KEY_LSHIFT) and btnp(KEY_UP) and hy>0 then
|
||||||
|
abad.hab=abad.hab-10
|
||||||
end
|
end
|
||||||
if abad.objects.gps~=nil then
|
if abad.objects.gps~=nil then
|
||||||
if btnp(KEY_1) then
|
if btnp(KEY_1) then
|
||||||
|
|||||||
6
map.lua
6
map.lua
@@ -393,9 +393,9 @@ mapa={
|
|||||||
{
|
{
|
||||||
24,29,28,29,28,29,28,29,8,9,26,27,
|
24,29,28,29,28,29,28,29,8,9,26,27,
|
||||||
24,256,256,256,256,256,256,256,8,9,25,25,
|
24,256,256,256,256,256,256,256,8,9,25,25,
|
||||||
24,256,256,256,256,256,256,256,8,9,26,27,
|
24,256,114,256,256,256,112,256,8,9,26,27,
|
||||||
24,256,114,121,256,256,112,256,8,9,25,25,
|
24,256,256,256,256,256,256,256,8,9,25,25,
|
||||||
24,256,256,101,102,103,256,256,8,9,26,27,
|
24,256,256,256,105,256,256,256,8,9,26,27,
|
||||||
24,29,28,29,28,29,28,29,28,29,25,25,
|
24,29,28,29,28,29,28,29,28,29,25,25,
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -76,6 +76,11 @@ scenes={
|
|||||||
{x=4,y=0,flip=false,text={"L'habitació de Batman!","Segur que els cacaus","estàn ahí dins."}},
|
{x=4,y=0,flip=false,text={"L'habitació de Batman!","Segur que els cacaus","estàn ahí dins."}},
|
||||||
{x=4,y=0,flip=false,text={"Però necessite","una clau...",""}}
|
{x=4,y=0,flip=false,text={"Però necessite","una clau...",""}}
|
||||||
},
|
},
|
||||||
|
bol_trobat={
|
||||||
|
{x=4,y=0,flip=false,text={"PER FI, JA TINC","ELS MEUS CACAUS!!!","OLE!! OLE!!"}},
|
||||||
|
{x=4,y=0,flip=false,text={"Se va a enterar","Batman ara quan","el pille..."}},
|
||||||
|
{x=4,y=0,flip=false,text={"Ara si que li puc","pegar una bona","cacauà..."}}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
function start_scene(scene)
|
function start_scene(scene)
|
||||||
|
|||||||
@@ -38,4 +38,6 @@ function score.draw()
|
|||||||
|
|
||||||
if abad.objects.clau_premiere~=nil then sspr(112,8,8,8,104,48) end
|
if abad.objects.clau_premiere~=nil then sspr(112,8,8,8,104,48) end
|
||||||
if abad.objects.clau_elalien~=nil then sspr(120,8,8,8,112,48) end
|
if abad.objects.clau_elalien~=nil then sspr(120,8,8,8,112,48) end
|
||||||
|
|
||||||
|
if abad.objects.bol~=nil then sspr(112,88,16,8,104,46) end
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user