diff --git a/abad.lua b/abad.lua index 43a8b3d..7a1303a 100644 --- a/abad.lua +++ b/abad.lua @@ -1,5 +1,5 @@ -abad={x=24,y=24,flip=false,frame=1,wait=0,hab=0,vides=3,energia=40,step=0,update=nil,jumpfwd=false,anim={0,1,0,2},bb={x=4,y=0,w=8,h=16}} +abad={x=40,y=24,flip=false,frame=1,wait=0,hab=10,vides=3,energia=40,step=0,update=nil,jumpfwd=false,anim={0,1,0,2},bb={x=4,y=0,w=8,h=16}} function abad_init() abad.update=abad_state_normal diff --git a/main.lua b/main.lua index b6cc551..95a4535 100644 --- a/main.lua +++ b/main.lua @@ -20,7 +20,7 @@ function _init() table.insert(actors,premiere) z = zombie.new() table.insert(actors,z) - c=caco.new(10,24,16) + c=caco.new(11,24,16) table.insert(actors,c) score.create() @@ -141,7 +141,8 @@ function update_game() prnt("x"..abad.vides,114,13,2) rectfill(102+(abad.energia>>1),30,122,37,16) - mapa_update() + mapa_update(abad.hab,premiere.hab) + for key,actor in pairs(actors) do actor:update() if actor.hab==cacau.hab and actor~=abad then diff --git a/map.lua b/map.lua index e2bed09..3329861 100644 --- a/map.lua +++ b/map.lua @@ -1,20 +1,20 @@ mapa={ -- 1 { - 18,19,20,21,20,21,20,21,18,19,20,21, - 16,72,256,256,256,15,256,256,256,17,256,256, - 16,88,256,256,256,256,256,256,256,17,256,256, - 16,256,256,256,256,256,256,256,256,38,256,256, - 16,256,256,256,256,256,256,256,256,38,256,256, - 20,21,20,21,20,21,20,21,20,21,20,21, + 256,256,256,18,19,21,20,21,20,21,20,21, + 64,68,256,16,72,256,256,256,256,256,256,256, + 256,256,66,256,88,256,256,70,71,256,256,256, + 256,66,256,16,256,112,256,86,87,256,114,256, + 66,256,256,16,256,256,256,256,256,256,256,256, + 256,64,256,16,20,21,20,21,20,21,20,21, }, -- 2 { 20,21,20,21,20,21,20,21,20,21,20,21, 256,256,256,256,256,256,256,256,256,256,256,256, - 256,256,256,256,256,256,256,256,256,256,256,256, - 256,256,69,256,256,256,69,256,256,256,69,256, + 256,256,73,74,256,256,256,256,73,74,256,256, + 256,256,89,90,256,256,256,256,89,90,256,256, 256,256,256,256,256,256,256,256,256,256,256,256, 20,21,20,21,20,21,21,256,80,17,20,21, @@ -23,30 +23,30 @@ mapa={ { 20,21,20,21,20,21,20,21,20,21,20,21, 256,256,256,256,256,256,256,256,256,256,256,256, - 256,256,256,256,256,256,256,256,256,256,256,256, - 256,256,256,256,256,256,256,256,256,256,256,256, + 256,96,97,96,256,73,74,256,97,96,96,256, + 256,99,256,100,256,89,90,256,99,256,100,256, 256,256,256,256,256,256,256,256,256,256,256,256, 20,21,20,21,20,21,20,21,20,21,20,21, }, -- 4 { - 20,21,20,21,20,21,20,21,20,21,20,21, - 256,256,256,256,256,256,256,256,256,256,256,256, - 256,256,256,256,256,256,256,256,256,256,256,256, - 256,256,256,256,256,256,256,256,256,256,256,256, + 20,21,20,21,20,21,20,21,20,21,18,19, + 256,256,256,256,256,256,256,256,256,256,77,17, + 256,73,74,256,256,73,74,256,98,98,93,17, + 256,89,90,256,256,89,90,256,99,100,256,256, 256,256,256,256,256,256,256,256,10,11,256,256, 20,21,20,21,20,21,20,21,10,11,20,21, }, -- 5 { - 20,21,20,21,20,21,20,21,20,21,20,16, - 256,256,256,256,256,256,256,256,256,256,256,16, - 256,256,256,256,256,256,256,256,256,256,256,16, - 256,256,256,256,256,256,256,256,256,256,256,16, - 256,256,256,256,256,256,256,256,256,256,256,16, - 20,21,20,21,20,21,20,21,20,21,20,21, + 66,256,256,67,256,65,256,64,256,256,256,66, + 256,256,64,256,256,256,256,256,256,68,256,67, + 18,19,18,19,18,19,18,19,256,256,65,256, + 256,256,256,256,256,256,256,256,256,256,256,256, + 256,256,256,256,256,256,256,16,256,64,256,66, + 20,21,20,21,20,21,20,21,256,256,66,256, }, -- 6 @@ -101,31 +101,31 @@ mapa={ }, -- 11 { - 25,29,28,29,28,29,28,29,28,29,28,29, - 24,256,256,256,256,256,256,256,256,256,256,256, - 24,256,256,256,256,70,71,256,256,256,256,256, - 24,256,256,256,69,86,87,69,256,256,256,256, - 24,256,256,256,256,256,256,256,256,256,256,256, - 28,29,28,29,28,29,28,29,28,29,28,29, + 256,66,26,27,28,29,28,29,26,27,28,29, + 256,256,256,24,256,256,256,256,15,25,256,256, + 64,68,256,256,256,256,256,256,256,25,256,256, + 256,256,66,24,256,256,256,256,256,38,256,256, + 256,66,256,24,101,102,103,256,256,38,256,256, + 66,256,256,24,28,29,28,29,28,29,28,29, }, -- 12 { - 28,29,28,29,28,29,29,256,256,256,28,29, - 256,256,256,256,256,256,256,256,256,25,256,256, - 256,256,256,256,256,256,256,256,1,256,256,256, - 256,256,256,256,256,256,256,1,256,256,256,256, + 28,29,28,29,28,29,29,256,256,256,26,27, + 256,256,256,256,256,256,256,256,256,25,72,256, + 256,256,73,74,256,256,256,256,1,256,88,256, + 256,256,89,90,256,256,256,1,256,256,256,256, 256,256,256,256,256,256,1,256,256,256,256,256, 28,29,28,29,28,29,28,29,28,29,28,29, }, -- 13 { - 28,29,28,29,28,29,28,29,28,29,28,29, - 256,256,256,256,256,256,256,256,256,256,256,256, - 256,256,256,256,256,256,256,256,256,256,256,256, - 256,256,256,256,256,256,256,256,256,256,256,256, - 256,256,256,256,256,256,256,256,256,256,256,256, + 28,29,26,27,26,27,28,29,28,29,28,29, + 256,256,256,26,27,256,256,256,256,256,256,256, + 256,256,256,256,256,256,256,256,73,74,256,256, + 256,256,256,98,98,256,256,256,89,90,256,256, + 256,256,104,101,102,103,256,256,256,256,256,256, 28,29,28,29,28,29,29,256,81,25,28,29, }, @@ -133,20 +133,20 @@ mapa={ { 28,29,28,29,28,29,28,29,10,11,28,29, 256,256,256,256,256,256,256,256,10,11,256,256, - 256,256,256,256,256,256,256,256,10,11,256,256, - 256,256,256,256,256,256,256,256,10,11,256,256, - 256,256,256,256,256,256,256,256,10,11,256,256, + 256,73,74,256,256,256,256,256,10,11,256,256, + 256,89,90,256,256,75,76,256,10,11,256,256, + 256,256,256,256,256,91,92,256,10,11,256,256, 28,29,28,29,28,29,28,29,28,29,28,29, }, -- 15 { - 28,29,28,29,28,29,28,29,28,29,28,24, - 256,256,256,256,256,256,256,256,256,256,256,24, - 256,256,256,256,256,256,256,256,256,256,256,24, - 256,256,256,256,256,256,256,256,256,256,256,24, - 256,256,256,256,256,256,256,256,256,256,256,24, - 28,29,28,29,28,29,28,29,28,29,28,29, + 26,27,26,27,28,29,28,29,26,27,26,27, + 28,29,256,256,256,256,256,256,256,256,28,24, + 256,256,256,256,256,73,74,256,256,256,256,24, + 256,256,75,76,256,89,90,256,75,76,256,24, + 256,256,91,92,256,256,256,256,91,92,256,24, + 26,27,28,29,28,29,28,29,28,29,26,27, }, -- 16 @@ -201,51 +201,51 @@ mapa={ }, -- 21 { - 33,37,36,37,36,37,36,37,36,37,36,37, + 34,35,36,37,36,37,36,37,36,37,36,37, 32,256,256,256,256,256,256,256,256,256,256,256, - 32,256,256,256,256,256,256,256,256,256,256,256, - 32,256,256,256,256,256,256,256,256,256,256,256, - 32,256,8,9,256,256,256,256,256,256,256,256, - 36,37,8,9,36,37,36,37,36,37,36,37, + 32,256,97,97,98,256,256,256,97,96,97,256, + 32,256,99,256,100,256,256,256,99,256,100,256, + 32,256,8,9,256,104,101,102,103,256,256,256, + 34,35,8,9,36,37,36,37,36,37,36,37, }, -- 22 { - 36,37,36,37,36,37,36,37,36,37,36,37, - 256,256,256,256,256,256,256,256,256,256,256,256, - 256,256,256,256,256,256,256,256,256,256,256,256, + 36,37,33,33,36,37,36,37,33,33,36,37, 256,256,256,256,256,256,256,256,256,256,256,256, + 256,256,256,256,96,97,96,98,256,256,256,256, + 256,256,113,256,99,256,256,100,256,114,256,256, 256,256,256,256,256,256,256,256,256,256,256,256, 36,37,36,37,36,37,36,37,36,37,36,37, }, -- 23 { - 36,37,36,37,36,37,37,256,256,256,36,37, + 37,36,37,36,37,36,37,256,256,256,36,37, 256,256,256,256,256,256,256,256,256,33,256,256, - 256,256,256,256,256,256,256,256,2,256,256,256, - 256,256,256,256,256,256,256,2,256,256,256,256, - 256,256,256,256,256,256,2,256,256,256,256,256, + 256,97,98,97,256,256,112,256,2,256,256,256, + 256,99,256,100,256,256,256,2,256,75,76,256, + 256,256,256,256,256,256,2,256,256,91,92,256, 36,37,36,37,36,37,36,37,36,37,36,37, }, -- 24 { - 36,37,36,37,36,37,36,37,36,37,36,37, - 256,256,256,256,256,256,256,256,256,256,256,256, - 256,256,256,256,256,256,256,256,256,256,256,256, - 256,256,256,256,256,256,256,256,256,256,256,256, + 34,35,256,256,256,256,256,256,256,256,34,35, + 256,2,34,35,34,35,34,35,34,35,2,256, + 256,256,113,256,256,112,114,256,256,114,256,256, 256,256,256,256,256,256,256,256,256,256,256,256, + 256,104,101,102,256,101,102,256,101,102,103,256, 36,37,36,37,36,37,36,37,36,37,36,37, }, -- 25 { - 36,37,36,37,36,37,36,37,36,37,36,33, - 256,256,256,256,256,256,256,256,256,256,256,32, - 256,256,256,256,256,256,256,256,256,256,256,32, - 256,256,256,256,256,256,256,256,256,256,256,32, - 256,256,256,256,256,256,256,256,8,9,256,32, + 36,37,36,37,36,37,36,37,36,37,34,35, + 256,256,256,256,256,256,73,74,256,256,77,32, + 256,256,96,97,96,256,89,90,256,256,93,32, + 256,256,99,256,100,256,256,256,256,256,256,32, + 256,256,256,256,256,101,102,103,8,9,256,32, 36,37,36,37,36,37,36,37,8,9,36,37, }, diff --git a/mapa.lua b/mapa.lua index 6c1373e..30b26df 100644 --- a/mapa.lua +++ b/mapa.lua @@ -62,21 +62,28 @@ function mapa_save() io.close(file) end -anim_tiles={177,178,176} -function mapa_update() +anim_tiles={113,114,112} +function mapa_update(hab1,hab2) mapa.wait=mapa.wait+1 if mapa.wait==6 then mapa.wait=0 - mapa.step=(mapa.step+1)&7 - for ty=0,5 do - for tx=0,11 do - local tile=mapa[1+hab][1+tx+ty*12] - if tile>=176 and tile<190 then - mapa[1+hab][1+tx+ty*12]=anim_tiles[tile-175] + mapa.step=(mapa.step+1)&31 + + local hab=hab1 + + repeat + for ty=0,5 do + for tx=0,11 do + local tile=mapa[1+hab][1+tx+ty*12] + if tile>=112 and tile<126 then + mapa[1+hab][1+tx+ty*12]=anim_tiles[tile-111] + end end end - end + if hab==hab2 then break end + hab=hab2 + until false end end @@ -84,7 +91,7 @@ function mapa_draw(hab) for ty=0,5 do for tx=0,11 do local tile=mapa[1+hab][1+tx+ty*12] - if tile~=256 and (tile<190 or mapa.step~=0) then + if tile~=256 and (tile<126 or mapa.step>4) then sspr((tile&15)*8,64+(tile>>4)*8,8,8,tx*8,ty*8) end end diff --git a/switches.lua b/switches.lua index 00a4eae..21835c0 100644 --- a/switches.lua +++ b/switches.lua @@ -4,8 +4,8 @@ switches={ current_list=nil, current_index=-1, } -switches[1]={} -switches[1][18]={1, 57,45} +switches[11]={} +switches[11][21]={11, 57,45} function switches.start(hab,tile) if switches.cooldown>0 then return end diff --git a/tiles.gif b/tiles.gif index fadc581..0fe089e 100644 Binary files a/tiles.gif and b/tiles.gif differ