From 838cd171ae85c9db2cc96a8d9b898347e48f146e Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Tue, 25 Oct 2022 19:07:21 +0200 Subject: [PATCH] - room beautifying finished - scenes - starters --- abad.lua | 2 +- game.ini | 2 +- main.lua | 17 ++++- map.lua | 180 +++++++++++++++++++++++++-------------------------- mapa.lua | 2 +- premiere.lua | 19 ++++-- scenes.lua | 117 +++++++++++++++++++++++++++++++++ starter.lua | 23 +++++++ tiles.gif | Bin 4020 -> 4063 bytes 9 files changed, 260 insertions(+), 102 deletions(-) create mode 100644 scenes.lua create mode 100644 starter.lua diff --git a/abad.lua b/abad.lua index 7a1303a..9b69998 100644 --- a/abad.lua +++ b/abad.lua @@ -31,7 +31,7 @@ function abad_state_normal() abad.jumpfwd=false elseif btn(KEY_DOWN) then abad.update=abad_state_crouch - elseif btn(KEY_SPACE) and cacau.hab==-1 then + elseif btnp(KEY_SPACE) and cacau.hab==-1 then abad.update=abad_state_fire abad.wait=0 cacau.init(abad.hab,abad.x+8,abad.y+8,abad.flip) diff --git a/game.ini b/game.ini index 6c401f9..b1db6aa 100644 --- a/game.ini +++ b/game.ini @@ -2,4 +2,4 @@ title=Cacaus width=128 height=96 zoom=4 -files=score.lua,switches.lua,map.lua,mapa.lua,cacau.lua,premiere.lua,caco.lua,zombie.lua,abad.lua,main.lua +files=scenes.lua,starter.lua,score.lua,switches.lua,map.lua,mapa.lua,cacau.lua,premiere.lua,caco.lua,zombie.lua,abad.lua,main.lua diff --git a/main.lua b/main.lua index 95a4535..db137ea 100644 --- a/main.lua +++ b/main.lua @@ -7,6 +7,14 @@ seltile = 0 actors={} +function remove_actor(actor) + for index, value in pairs(actors) do + if value == actor then + table.remove(actors,index) + end + end +end + function _init() tiles=loadsurf("tiles.gif") setsource(tiles) @@ -22,6 +30,8 @@ function _init() table.insert(actors,z) c=caco.new(11,24,16) table.insert(actors,c) + + table.insert(actors,starter.new(10,44,32,scenes.abad_inici)) score.create() _update=update_game @@ -72,6 +82,7 @@ function update_dialog() _update=update_game end end + scroll=0 function update_game() cls(16) @@ -147,8 +158,10 @@ function update_game() actor:update() if actor.hab==cacau.hab and actor~=abad then if aabb(actor,cacau) then - actor:hit() - cacau.hab=-1 + if actor.hit~=nil then + actor:hit() + cacau.hab=-1 + end end end end diff --git a/map.lua b/map.lua index a2a9dc2..e45db08 100644 --- a/map.lua +++ b/map.lua @@ -104,7 +104,7 @@ mapa={ 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,256,66,24,256,121,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, @@ -163,19 +163,19 @@ mapa={ { 28,29,28,29,25,41,44,45,44,45,44,45, 256,256,256,256,25,41,256,256,256,256,256,256, - 256,256,256,256,25,41,256,256,256,256,256,256, - 256,256,256,256,25,41,256,256,256,256,256,256, - 256,256,256,256,25,41,256,256,256,256,256,256, + 256,73,74,256,25,41,256,256,73,74,256,256, + 256,89,90,78,25,41,256,256,89,90,256,256, + 256,256,95,94,25,41,256,256,256,256,256,256, 28,29,28,29,25,41,44,45,44,45,44,45, }, -- 18 { 44,45,44,45,41,256,256,41,44,45,44,45, + 256,256,256,256,256,69,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,41,41,256,256,41,41,256,256,256, + 256,256,256,256,256,256,69,256,256,256,256,256, + 256,256,256,41,41,256,69,41,41,256,256,256, 45,44,45,42,43,256,256,42,43,44,45,44, }, @@ -183,8 +183,8 @@ mapa={ { 44,45,44,45,44,45,44,45,44,45,44,45, 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,97,98,97,256,73,74,256,98,97,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, 44,45,44,45,44,45,256,83,41,45,44,45, @@ -192,9 +192,9 @@ mapa={ -- 20 { 44,45,44,45,44,45,256,256,41,41,41,41, - 256,256,256,256,256,256,256,256,41,256,42,43, - 256,256,256,256,256,256,256,3,256,256,41,41, - 256,256,256,256,256,256,3,256,256,256,42,43, + 256,256,256,256,256,256,256,256,41,77,42,43, + 256,256,73,74,256,256,256,3,256,93,41,41, + 256,256,89,90,256,256,3,256,256,256,42,43, 256,256,256,256,256,3,256,256,8,9,41,41, 44,45,44,45,44,45,44,45,8,9,42,43, @@ -244,7 +244,7 @@ mapa={ 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,96,97,96,256,256,89,90,256,256,93,32, - 256,99,256,100,256,256,256,256,256,256,256,32, + 256,99,256,100,256,121,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,33,32, @@ -263,8 +263,8 @@ mapa={ { 17,17,18,19,17,17,18,19,17,17,18,19, 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,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, 17,17,18,19,17,256,80,17,18,19,17,17, @@ -272,11 +272,11 @@ mapa={ -- 28 { 18,19,17,18,19,256,256,33,33,34,35,33, - 256,256,256,17,17,256,256,34,35,256,256,256, - 256,256,256,18,19,256,256,33,33,256,256,256, - 256,256,256,17,17,256,256,34,35,256,256,256, - 256,256,256,18,19,256,256,33,33,256,256,256, - 17,18,19,17,17,256,256,34,35,33,33,34, + 256,256,256,17,17,256,69,34,35,72,256,256, + 256,256,256,18,19,256,69,33,33,88,256,256, + 256,256,256,17,16,256,256,34,35,256,256,256, + 256,256,256,18,19,69,256,41,33,256,256,256, + 17,18,19,17,17,69,256,34,35,33,33,34, }, -- 29 @@ -284,8 +284,8 @@ mapa={ 36,37,36,37,36,37,256,256,256,33,34,35, 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, + 256,117,98,256,256,256,2,256,256,106,116,256, + 256,101,102,103,256,2,256,256,104,101,102,256, 34,35,33,33,34,35,33,33,34,35,33,33, }, @@ -293,9 +293,9 @@ mapa={ { 33,33,34,35,33,33,34,35,8,9,33,33, 256,256,256,256,256,256,33,33,8,9,34,35, - 256,256,256,256,256,256,34,35,8,9,33,33, - 256,256,256,256,256,256,33,33,8,9,34,35, - 256,256,256,256,256,256,34,35,8,9,33,33, + 256,256,256,256,256,97,34,35,8,9,33,33, + 256,256,256,256,115,100,33,33,8,9,34,35, + 256,256,256,104,101,102,34,35,8,9,33,33, 34,35,33,33,34,35,33,33,8,9,34,35, }, @@ -334,7 +334,7 @@ mapa={ 40,40,40,40,40,40,40,40,40,40,40,40, 45,44,45,44,45,44,45,44,45,44,45,40, 256,256,256,256,256,256,256,256,73,74,256,40, - 256,256,113,256,256,114,256,256,89,90,256,40, + 256,256,113,256,256,114,256,121,89,90,256,40, 256,256,256,256,256,256,256,101,102,103,256,40, 44,45,41,83,256,44,45,44,45,44,45,40, @@ -372,31 +372,31 @@ mapa={ -- 38 { 27,26,27,28,29,256,256,28,29,26,27,26, - 29,256,256,256,256,256,256,256,256,256,256,28, + 29,256,256,256,256,256,69,256,256,256,256,28, 256,256,98,96,98,256,256,98,98,96,256,256, 256,256,99,256,100,256,256,99,256,100,256,256, - 256,256,256,256,256,256,256,256,10,11,256,256, + 256,256,256,256,256,69,256,256,10,11,256,256, 29,28,29,28,29,256,256,28,10,11,29,28, }, -- 39 { - 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,25,25,28,29,25,25,28,29,25,25, + 256,256,25,25,256,256,256,256,256,256,106,24, + 256,256,256,69,256,256,256,256,256,256,95,24, + 256,256,256,256,78,97,107,108,256,106,105,24, + 256,256,69,256,94,101,102,110,103,105,98,24, 28,29,256,256,28,29,28,29,28,29,28,29, }, -- 40 { - 28,29,28,29,28,29,28,29,8,9,26,27, - 256,256,256,256,256,256,256,256,8,9,25,25, - 256,256,256,256,256,256,256,256,8,9,26,27, - 256,256,256,256,256,256,256,256,8,9,25,25, - 256,256,256,256,256,256,256,256,8,9,26,27, - 28,29,28,29,28,29,28,29,28,29,25,25, + 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,26,27, + 24,256,114,121,256,256,112,256,8,9,25,25, + 24,256,256,101,102,103,256,256,8,9,26,27, + 24,29,28,29,28,29,28,29,28,29,25,25, }, -- 41 @@ -452,10 +452,10 @@ mapa={ -- 46 { 18,19,18,19,256,256,256,20,21,20,21,20, - 18,19,256,256,17,256,256,256,256,256,256,256, - 18,19,256,256,256,0,256,256,256,256,256,256, - 18,19,256,256,256,256,0,256,256,256,256,256, - 18,19,256,256,256,256,256,0,256,256,256,256, + 18,19,72,256,17,256,256,256,256,256,256,256, + 18,19,88,256,256,0,256,256,256,256,256,256, + 18,19,256,75,76,78,0,256,256,116,256,256, + 18,19,256,91,92,94,95,0,256,101,102,256, 18,19,18,19,18,19,18,19,18,19,18,19, }, @@ -463,40 +463,40 @@ 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,97,96,98,97,256,256,96,97,98,96,256, + 114,99,256,256,100,114,114,99,256,256,100,114, 256,256,256,256,256,256,256,256,256,256,256,256, 18,19,18,19,18,19,18,19,18,19,18,19, }, -- 48 { - 21,20,21,20,21,256,256,20,10,11,20,21, - 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, + 20,21,20,21,17,256,256,17,10,11,20,21, + 256,256,256,256,256,256,69,256,10,11,256,256, + 256,256,96,97,256,256,69,256,10,11,256,256, + 256,115,99,100,256,256,256,256,10,11,256,256, + 256,101,102,103,256,69,256,256,10,11,256,256, 19,18,19,18,19,256,256,18,19,18,19,18, }, -- 49 { - 20,21,256,256,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,256,256,256,256,256,256,256,256,256,256,256, - 18,19,256,256,18,19,18,19,18,19,18,19, + 20,21,256,69,18,19,18,19,20,21,20,21, + 256,256,256,256,256,256,256,256,256,256,114,256, + 256,256,69,256,256,256,114,256,256,256,256,256, + 256,114,69,256,256,256,256,256,17,18,19,17, + 256,256,256,256,18,19,18,19,18,19,18,19, + 18,19,256,256,17,18,19,18,19,18,19,17, }, -- 50 { 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, - 19,18,19,18,19,18,19,256,80,17,18,19, + 256,114,256,256,256,256,256,256,256,256,98,16, + 256,256,256,256,256,256,256,256,256,256,100,16, + 17,19,256,256,256,114,256,256,256,256,78,16, + 18,19,18,19,256,256,256,256,256,256,94,16, + 17,18,19,18,19,18,19,256,80,17,18,19, }, -- 51 @@ -571,19 +571,19 @@ mapa={ }, -- 58 { - 35,34,35,34,35,256,256,34,35,34,35,34, - 256,256,256,256,256,256,256,256,256,256,256,256, + 35,34,35,34,35,69,256,34,35,34,35,34, + 256,256,256,256,256,69,256,256,256,256,256,256, 256,113,70,71,114,256,256,112,107,108,113,256, - 256,256,86,87,256,256,256,256,109,110,256,256, - 256,256,256,256,256,256,256,256,256,256,256,256, + 256,256,86,87,256,256,69,256,109,110,256,256, + 256,256,256,256,256,256,69,256,256,256,256,256, 37,36,37,36,37,256,256,36,37,36,37,36, }, -- 59 { 34,35,256,256,34,35,34,35,34,35,34,35, - 256,256,256,256,256,256,256,256,256,256,256,256, - 256,256,256,256,256,256,97,96,256,256,256,256, + 256,256,256,69,256,256,256,256,256,256,256,256, + 256,256,69,256,256,256,97,96,256,256,256,256, 256,256,256,256,256,256,99,100,256,256,256,256, 256,41,120,119,41,256,256,256,8,9,256,256, 3,41,46,47,41,3,36,37,8,9,36,37, @@ -592,10 +592,10 @@ mapa={ -- 60 { 35,34,35,34,35,34,35,256,256,33,34,35, - 256,256,256,256,256,256,256,256,256,33,34,35, - 256,256,256,256,256,256,256,256,2,256,34,35, - 256,256,256,256,256,256,256,2,256,256,34,35, - 256,256,256,256,256,256,2,256,256,256,34,35, + 256,256,36,37,256,256,256,256,256,33,34,35, + 256,256,256,256,256,256,256,256,2,77,34,35, + 256,256,116,256,256,256,256,2,256,93,34,35, + 256,256,101,102,103,256,2,256,256,256,34,35, 36,37,36,37,36,37,36,37,36,37,36,37, }, @@ -671,32 +671,32 @@ mapa={ }, -- 68 { - 25,28,29,28,29,256,256,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, - 28,28,29,28,29,256,256,28,29,28,29,28, + 25,28,29,26,27,256,69,26,27,28,29,28, + 24,97,256,256,256,256,256,256,256,256,256,256, + 24,99,256,256,256,69,256,256,256,256,256,256, + 24,256,95,256,113,69,256,256,114,75,76,256, + 24,101,102,103,256,256,256,256,256,91,92,256, + 28,28,29,28,29,256,69,28,29,28,29,28, }, -- 69 { - 28,29,28,29,28,29,28,29,8,9,28,29, + 28,29,26,27,26,27,28,29,8,9,28,29, + 256,256,256,28,29,256,256,256,8,9,256,256, 256,256,256,256,256,256,256,256,8,9,256,256, - 256,256,256,256,256,256,256,256,8,9,256,256, - 256,256,256,256,256,256,256,256,8,9,256,256, - 256,256,256,256,256,256,256,256,8,9,256,256, - 28,29,28,29,28,29,28,29,8,9,28,29, + 75,76,75,76,75,76,75,76,8,9,256,256, + 91,92,91,92,91,92,91,92,8,9,256,256, + 28,29,1,26,27,1,28,29,8,9,28,29, }, -- 70 { - 28,29,26,27,26,27,26,27,26,27,26,27, - 256,256,256,256,28,29,26,27,26,27,26,27, - 256,256,256,256,256,256,256,256,28,29,26,27, - 256,256,256,256,256,69,256,256,256,256,256,256, - 256,256,256,256,256,256,256,256,26,27,26,27, - 28,29,28,29,26,27,26,27,26,27,26,27, + 28,29,26,27,25,25,256,256,65,256,256,256, + 256,256,256,77,26,27,256,256,256,68,256,256, + 256,256,256,93,25,25,256,256,256,256,66,256, + 256,256,256,78,26,27,256,66,256,256,256,67, + 256,256,95,94,25,25,256,256,256,256,256,256, + 28,29,28,29,26,27,54,56,54,56,55,54, }, -- 71 @@ -772,8 +772,8 @@ mapa={ -- 78 { 51,52,53,51,52,256,256,52,53,51,52,17, - 256,256,256,256,256,256,256,256,256,256,256,17, - 256,256,256,256,256,256,256,106,256,256,256,17, + 256,256,256,256,256,256,69,256,256,256,256,17, + 256,256,256,256,256,69,256,106,256,256,256,17, 256,256,256,256,17,256,256,17,256,256,78,17, 256,256,256,256,17,118,119,17,256,95,94,17, 51,52,53,53,51,53,52,53,51,52,51,17, diff --git a/mapa.lua b/mapa.lua index eee4e31..7b23017 100644 --- a/mapa.lua +++ b/mapa.lua @@ -62,7 +62,7 @@ function mapa_save() io.close(file) end -anim_tiles={113,114,112,116,117,115,119,120,118} +anim_tiles={113,114,112,116,117,115,119,120,118,122,121} function mapa_update(hab1,hab2) mapa.wait=mapa.wait+1 diff --git a/premiere.lua b/premiere.lua index e0b8af1..2970908 100644 --- a/premiere.lua +++ b/premiere.lua @@ -1,4 +1,4 @@ -premiere={hab=44,x=24,y=24,flip=true,frame=0,wait=0,step=0,anim={11,12,11,13},bb={x=4,y=0,w=8,h=16}} +premiere={hab=44,x=24,y=24,flip=true,frame=11,wait=0,step=0,anim={11,12,11,13},bb={x=4,y=0,w=8,h=16},scene_intro=false,scene_object=false} function premiere.init() premiere.hit=premiere.hit @@ -49,12 +49,17 @@ function premiere.update_normal() premiere.update=premiere.update_falling end --- if premiere.hab==abad.hab then --- if aabb(abad,premiere) then --- if abad.energia>0 then abad.energia=abad.energia-1 end --- cls(3) --- end --- end + if premiere.hab==abad.hab then + if aabb(abad,premiere) then + if not premiere.scene_intro then + start_scene(scenes.premiere_intro) + premiere.scene_intro=true + elseif not premiere.scene_object and abad.objects.gorro~=nil then + start_scene(scenes.premiere_gorro) + premiere.scene_object=true + end + end + end end end diff --git a/scenes.lua b/scenes.lua new file mode 100644 index 0000000..ccdb068 --- /dev/null +++ b/scenes.lua @@ -0,0 +1,117 @@ +scenes={ + abad_inici={ + {x=4,y=0,flip=false,text={"Be, millor me fique a","buscar... com s'eixia","d'esta habitacio???"}}, + {x=4,y=0,flip=true,text={"Perque parles en","tu mateix?",""}}, + {x=4,y=0,flip=false,text={"No se, tio...","",""}} + } + --premiere_intro={x=4,y=0,text={"Be, millor me fique a","buscar... com s'eixia","d'esta habitacio???"}} +} + +function start_scene(scene) + bkg=newsurf(128,96) + setdest(bkg) + setsource(0) + sspr(0,0,128,96,0,0) + setsource(tiles) + setdest(0) + _update=update_scene + scenes.current_scene=scene + scenes.dnum=1 + scenes.step=0 + scenes.char=1 + scenes.wait=0 +end + +function draw_scene() + local txt_x = not scenes.current_scene[scenes.dnum].flip and 38 or 8 + camera(0,-28) + if scenes.step==0 then + rectfill(0,16,128,17,12) + line(0,15,128,15,16) + line(0,18,128,18,16) + elseif scenes.step==1 then + rectfill(0,8,128,26,12) + line(0,7,128,7,16) + line(0,27,128,27,16) + elseif scenes.step==2 then + rectfill(0,0,128,34,12) + line(0,0,128,0,16) + line(0,34,128,34,16) + elseif scenes.step==3 then + if not scenes.current_scene[scenes.dnum].flip then + rectfill(8,12,31,23,16) + sspr(scenes.current_scene[scenes.dnum].x,scenes.current_scene[scenes.dnum].y,10,10,9,13,20,10) + else + rectfill(97,12,120,23,16) + sspr(scenes.current_scene[scenes.dnum].x,scenes.current_scene[scenes.dnum].y,10,10,98,13,20,10,true) + end + elseif scenes.step==4 then + if not scenes.current_scene[scenes.dnum].flip then + rectfill(8,7,31,28,16) + sspr(scenes.current_scene[scenes.dnum].x,scenes.current_scene[scenes.dnum].y,10,10,9,8,20,20) + else + rectfill(97,7,120,28,16) + sspr(scenes.current_scene[scenes.dnum].x,scenes.current_scene[scenes.dnum].y,10,10,98,8,20,20,true) + end + elseif scenes.step==5 then + text(string.sub(scenes.current_scene[scenes.dnum].text[1],1,scenes.char),txt_x,7,2) + if scenes.char<#scenes.current_scene[scenes.dnum].text[1] then + scenes.step=scenes.step-1 + scenes.char=scenes.char+1 + else + scenes.char=1 + end + elseif scenes.step==6 then + text(string.sub(scenes.current_scene[scenes.dnum].text[2],1,scenes.char),txt_x,15,2) + if scenes.char<#scenes.current_scene[scenes.dnum].text[2] then + scenes.step=scenes.step-1 + scenes.char=scenes.char+1 + else + scenes.char=1 + end + elseif scenes.step==7 then + text(string.sub(scenes.current_scene[scenes.dnum].text[3],1,scenes.char),txt_x,23,2) + if scenes.char<#scenes.current_scene[scenes.dnum].text[3] then + scenes.step=scenes.step-1 + scenes.char=scenes.char+1 + else + scenes.char=1 + end + elseif scenes.step==8 then + rectfill(0,0,128,34,12) + line(0,0,128,0,16) + line(0,34,128,34,16) + if not scenes.current_scene[scenes.dnum].flip then + rectfill(8,7,31,28,16) + sspr(scenes.current_scene[scenes.dnum].x,scenes.current_scene[scenes.dnum].y,10,10,9,8,20,20) + else + rectfill(97,7,120,28,16) + sspr(scenes.current_scene[scenes.dnum].x,scenes.current_scene[scenes.dnum].y,10,10,98,8,20,20,true) + end + text(scenes.current_scene[scenes.dnum].text[1],txt_x,7,2) + text(scenes.current_scene[scenes.dnum].text[2],txt_x,15,2) + text(scenes.current_scene[scenes.dnum].text[3],txt_x,23,2) +end + if scenes.step<=8 then scenes.step=scenes.step+1 end + camera(0,0) +end + +function update_scene() + scenes.wait=scenes.wait+1 + + if scenes.wait==6 then + scenes.wait=0 + draw_scene() + end + if btnp(KEY_SPACE) and scenes.step>8 then + if scenes.dnum==#scenes.current_scene then + freesurf(bkg) + _update=update_game + else + scenes.dnum=scenes.dnum+1 + scenes.step=2 + end + elseif anykey() then + scenes.step=8 + end +end diff --git a/starter.lua b/starter.lua new file mode 100644 index 0000000..f870106 --- /dev/null +++ b/starter.lua @@ -0,0 +1,23 @@ +starter={} + +function starter.new(_hab,_x,_y,_scene) + return {hab=_hab,x=_x,y=_y,scene=_scene,update=starter.update,draw=starter.draw,bb={x=0,y=0,w=8,h=8}} +end + +function starter:draw() + -- do nothing + --rectfill(self.x,self.y,self.x+8,self.y+8,3) +end + +function starter:update() + if self.hab==abad.hab then + if aabb(abad,self) then + starter.do_touched(self) + end + end +end + +function starter:do_touched() + start_scene(self.scene) + remove_actor(self) +end \ No newline at end of file diff --git a/tiles.gif b/tiles.gif index 124d8a6306f00dfac1852124bc1e01931e614ec7..7d1f0b2400aaf781a1c6229bb3a5bf8bf610f2dd 100644 GIT binary patch delta 1065 zcmV+^1lIesAKxFa#tVPo$U#JJkk$$$^rjz($DO`<+MxdR`t1BdK(7!#F#rIzU!x#P zGD!o3{`aR>J;+(__(TB!X~8!=@IQn4RMEcne!{(ewi|U zZvlG0MG;XU7g>P-7ifP4sCe(Ucmn}~A;5ef`IPBRGG4NvMGbg?un^A1@e#&h=c~CxjLFfeM&|JGg%ffqw;+074Z~@>dW5 zfD+pQ0P4|$OIUfBhJzuvg9CUGW_X5JC4X1=8ZgL)*A;vQXo1{!gJI|=380Aehk^tD zVTON4e3)lD=c0x~=z?+qhhI{NOlWq9_=J0cha$0uf7gF~ljtTjDRSMB^%%~f>*n9q{TngEb3=xqNp%Gg#ksyhZ@|Y2I=V&iBIS_v!xgI=eds~4J43LmjxqwDFToD6xCu=~&?j zpXkzu@(Eck6-F@ipDuNt`U#;9ID3wmgn}cXAv9I>nV!apFbfJ>21-}qNgfMfq6&ec z*L9&RIuIKAL{9ah8tPAt^;lh$q6GjE5z>dgwE{W)**orZkB8^QPmD(Nk3*EXjTDSAzW3s^0aLXZ=8oPyE#Te)$72 zfd4<6KU@R^H=kR1?(wk?00t~x`vOV8Mda^W=Tb!c+pIhJU21>++lNFbVqtyAcY5&G zewC*XdeVM=vVaVbfZjKN5P^UE1bVRt0OWBM0`VHq_YkpneH;OQ3CMs8SbX(Yfwz|_ z;Aa&SsD2h$0RESOhrttcVSlLCdJ5rw2N-|yCxU+BfHla1CkRj!s1W0Ufj8kRM~DCb z024q+fD3_xz^8wBJII4RxO_mkgb)Q2_mLG!SP-=5TC6vM3g~_yIE5nUfcv))64+2) zh!WeegfpRjjt7OSw|!>FfK`}+;TKU__!?cfhCgV713`y^SbTSw06kcLH5h@wXLcX| zXHab@7m)#nAE}ZfD1szd zdRQodk9cPRQIgYz06QoxXtN-XH z2RT(XsE`a^Ecld^hSd1qaj6IF?YpHY?o zFq0{Fdmy1(BT13E6n%SXajbQW)EIMTbp@ZyX**{mdSP`0Q|Reb=2x31v0qmxfL~aCi!@c@8K2JC zSdVp|E$D(oScDDApx2dx|H*>;IiTa2I2HPxuqB^e)SwXIpdM;?3ZZ$3N1`Jd0R7pY r7rLStilOYOp)p0E`vsx{L8Ag;qbhZxnrC=g=Z8Leo*Kwd0RaFz9V*)@