2 Commits
v1.1 ... v1.1.1

6 changed files with 116 additions and 26 deletions

View File

@@ -1,4 +1,6 @@
require "dead"
abad={x=40,y=24,flip=false,frame=1,wait=0,respawning=0,hab=10,vides=3,energia=40,falling=0,step=0, mustep=1,hurting=0,update=nil,jumpfwd=false,anim={0,1,0,2},bb={x=4,y=0,w=8,h=16},safe={hab=10,x=40,y=24}} abad={x=40,y=24,flip=false,frame=1,wait=0,respawning=0,hab=10,vides=3,energia=40,falling=0,step=0, mustep=1,hurting=0,update=nil,jumpfwd=false,anim={0,1,0,2},bb={x=4,y=0,w=8,h=16},safe={hab=10,x=40,y=24}}
function abad_nop() function abad_nop()

View File

@@ -1,4 +1,22 @@
--hab=0 require "abad"
require "gps"
require "gorro"
require "peu"
require "premiere"
require "elalien"
require "batman"
require "bol"
require "gota"
require "invisibl"
require "zombie"
require "caco"
require "trigger"
require "score"
require "imp"
require "bambolla"
require "cacau"
require "fireball"
require "switches"
modes={playing=0,editing=1} modes={playing=0,editing=1}
--mode=modes.editing --mode=modes.editing
@@ -147,20 +165,6 @@ function game_init(menu)
--fade.fadein() --fade.fadein()
end end
function text(str,x,y,col)
color(16)
prnt(str,x-1,y-1)
prnt(str,x,y-1)
prnt(str,x+1,y-1)
prnt(str,x-1,y)
prnt(str,x+1,y)
prnt(str,x-1,y+1)
prnt(str,x,y+1)
prnt(str,x+1,y+1)
prnt(str,x,y,col)
end
function draw_hab(hab,x,y,editing) function draw_hab(hab,x,y,editing)
camera(-x,-y) camera(-x,-y)
mapa_draw(hab) mapa_draw(hab)
@@ -311,7 +315,7 @@ function update_game()
--elseif btnp(KEY_ESCAPE) then --elseif btnp(KEY_ESCAPE) then
-- pause() -- pause()
--end --end
if btnp(KEY_ESCAPE) then if btnp(KEY_ESCAPE) or padp(btnPause) then
pause() pause()
end end
if abad.objects.gps~=nil then if abad.objects.gps~=nil then
@@ -326,6 +330,17 @@ function update_game()
elseif btnp(KEY_5) then elseif btnp(KEY_5) then
current_camera=5 current_camera=5
end end
if padp(btnCycle1) then
current_camera=current_camera+1
if current_camera==6 then current_camera=1 end
if current_camera==1 and (abad.objects.gorro or abad.objects.clau_premiere) then current_camera=2 end
if current_camera==2 and (abad.objects.peu or abad.objects.clau_elalien) then current_camera=3 end
elseif padp(btnCycle2) then
current_camera=current_camera-1
if current_camera==0 then current_camera=5 end
if current_camera==2 and (abad.objects.peu or abad.objects.clau_elalien) then current_camera=1 end
if current_camera==1 and (abad.objects.gorro or abad.objects.clau_premiere) then current_camera=5 end
end
end end
end end
end end
@@ -395,7 +410,7 @@ function update_menu()
else else
playmus(audio_main_song) playmus(audio_main_song)
end end
elseif btnp(KEY_ESCAPE) then elseif btnp(KEY_ESCAPE) or padp(btnPause) then
quit() quit()
end end
elseif menu_state==1 then elseif menu_state==1 then
@@ -528,6 +543,7 @@ function pause()
sspr(0,0,128,96,0,0) sspr(0,0,128,96,0,0)
setdest(0) setdest(0)
setsource(tiles) setsource(tiles)
pausa_option=1
pause_old_update=game_update pause_old_update=game_update
game_update=update_pause game_update=update_pause
end end
@@ -536,16 +552,30 @@ function update_pause()
rectfill(16,16,112,80,16) rectfill(16,16,112,80,16)
rect(16,16,112,80,15) rect(16,16,112,80,15)
prnt("PAUSA",54,30,15) prnt("PAUSA",54,30,15)
prnt("ESC torna al joc",30,50,14) if pausa_option==1 then
prnt("SPACE eixir",30,60,14) rect(28,48,100,56,13)
else
rect(28,58,100,66,13)
end
prnt("CONTINUAR",30,50,14)
prnt("EIXIR",30,60,14)
if btnp(KEY_ESCAPE) then if btnp(KEY_ESCAPE) then
setsource(back) setsource(back)
sspr(0,0,128,96,0,0) sspr(0,0,128,96,0,0)
setsource(tiles) setsource(tiles)
game_update = pause_old_update game_update = pause_old_update
elseif btnp(keyDown) or btnp(keyUp) or padp(btnDown) or padp(btnUp) then
if pausa_option==1 then pausa_option=2 else pausa_option=1 end
elseif btnp(keyShoot) or padp(btnShoot) then elseif btnp(keyShoot) or padp(btnShoot) then
if pausa_option==1 then
setsource(back)
sspr(0,0,128,96,0,0)
setsource(tiles)
game_update = pause_old_update
else
game_exit() game_exit()
game_init(true) game_init(true)
end end
end
end end

View File

@@ -1,3 +1,8 @@
require "fade"
require "game"
require "mapa"
require "scenes"
intro_wait=40 intro_wait=40
intro_step=0 intro_step=0
@@ -19,7 +24,7 @@ function intro_intro()
--text("JAILGAMES",40,30,15) --text("JAILGAMES",40,30,15)
text("presenta",48,50,14) text("presenta",48,50,14)
intro_wait=intro_wait-1 intro_wait=intro_wait-1
if intro_wait==0 or btnp(KEY_ESCAPE) or btnp(keyShoot) or padp(btnShoot) then if intro_wait==0 or btnp(KEY_ESCAPE) or btnp(keyShoot) or padp(btnShoot) or padp(btnPause) then
intro_wait=1 intro_wait=1
game_update = intro_update game_update = intro_update
fade.fadeoutin() fade.fadeoutin()
@@ -30,7 +35,7 @@ function intro_intro()
end end
function intro_update() function intro_update()
if btnp(KEY_ESCAPE) then if btnp(KEY_ESCAPE) or padp(btnPause) then
game_init(true) game_init(true)
fade.fadeoutin() fade.fadeoutin()
elseif btnp(KEY_SPACE) then elseif btnp(KEY_SPACE) then

View File

@@ -1,3 +1,35 @@
require "final"
require "fade"
require "audio"
require "dead"
require "scenes"
require "trigger"
require "score"
require "switches"
require "map"
require "mapa"
require "bol"
require "invisibl"
require "gota"
require "fireball"
require "cacau"
require "bambolla"
require "imp"
require "gps"
require "peu"
require "gorro"
require "batman"
require "elalien"
require "premiere"
require "caco"
require "zombie"
require "abad"
require "intro"
require "game"
--require "fade"
--require "audio"
--require "intro"
function _init() function _init()
tiles=loadsurf("tiles.gif") tiles=loadsurf("tiles.gif")
@@ -36,8 +68,11 @@ function _init()
btnDown = tonumber(getconf("btndown")) or BTN_DOWN btnDown = tonumber(getconf("btndown")) or BTN_DOWN
btnLeft = tonumber(getconf("btnleft")) or BTN_LEFT btnLeft = tonumber(getconf("btnleft")) or BTN_LEFT
btnRight = tonumber(getconf("btnright")) or BTN_RIGHT btnRight = tonumber(getconf("btnright")) or BTN_RIGHT
btnJump = tonumber(getconf("btnjump")) or BTN_UP btnJump = tonumber(getconf("btnjump")) or BTN_B
btnShoot = tonumber(getconf("btnshoot")) or BTN_A btnShoot = tonumber(getconf("btnshoot")) or BTN_A
btnCycle1 = tonumber(getconf("btnCycle1")) or BTN_RIGHTSHOULDER
btnCycle2 = tonumber(getconf("btnCycle2")) or BTN_LEFTSHOULDER
btnPause = tonumber(getconf("btnPause")) or BTN_START
--game_init() --game_init()
intro_init() intro_init()
@@ -57,3 +92,17 @@ function _update()
if (game_update) then game_update() end if (game_update) then game_update() end
end end
function text(str,x,y,col)
color(16)
prnt(str,x-1,y-1)
prnt(str,x,y-1)
prnt(str,x+1,y-1)
prnt(str,x-1,y)
prnt(str,x+1,y)
prnt(str,x-1,y+1)
prnt(str,x,y+1)
prnt(str,x+1,y+1)
prnt(str,x,y,col)
end

View File

@@ -1,4 +1,5 @@
--mapa={} require "map"
tiletype={void=0,nonpc=1,stair=2,switch=3,half=4,block=5} tiletype={void=0,nonpc=1,stair=2,switch=3,half=4,block=5}
mapa.wait=0 mapa.wait=0
mapa.step=0 mapa.step=0

View File

@@ -1,3 +1,6 @@
require "final"
require "audio"
scenes={ scenes={
intro_01= { intro_01= {
{x=3,y=0,flip=false,audio="abad",text={"Ah!, què bo!","Nit de Netflix amb","un bon bol de cacaus!"},die=20}, {x=3,y=0,flip=false,audio="abad",text={"Ah!, què bo!","Nit de Netflix amb","un bon bol de cacaus!"},die=20},
@@ -272,7 +275,7 @@ function update_scene()
end end
end end
if btnp(KEY_ESCAPE) and (scenes.current_scene~=scenes.final) then if (btnp(KEY_ESCAPE) or padp(btnPause)) and (scenes.current_scene~=scenes.final) then
if scenes.current_scene[scenes.dnum].die then if scenes.current_scene[scenes.dnum].die then
game_init(true) game_init(true)
else else