- Passat a mini v1.3.6

This commit is contained in:
2025-10-30 12:39:44 +01:00
parent 5fef769534
commit a5d097aa50
26 changed files with 396 additions and 399 deletions

View File

@@ -19,7 +19,7 @@ function abad:draw()
flip=(((abad.x>>1)+(abad.y>>1))%2)==0 flip=(((abad.x>>1)+(abad.y>>1))%2)==0
end end
if (abad.respawning==0) or (math.floor(abad.respawning/15)%2==0) then if (abad.respawning==0) or (math.floor(abad.respawning/15)%2==0) then
blit(abad.frame*16,0,16,16,abad.x,abad.y,16,16,flip) draw.surf(abad.frame*16,0,16,16,abad.x,abad.y,16,16,flip)
end end
if abad.respawning > 0 then if abad.respawning > 0 then
@@ -57,10 +57,10 @@ function abad_hurt(howmuch)
abad.bb.y=0 abad.bb.y=0
abad.bb.h=16 abad.bb.h=16
abad.respawning=240 abad.respawning=240
cls(3) surf.cls(3)
end end
else else
cls(3) surf.cls(3)
end end
end end
end end
@@ -83,26 +83,26 @@ function abad_state_normal()
end end
abad_make_safe() abad_make_safe()
if btn(keyRight) or pad(btnRight) then if key.down(keyRight) or pad.down(btnRight) then
abad.update=abad_state_walking abad.update=abad_state_walking
abad.flip=false abad.flip=false
elseif btn(keyLeft) or pad(btnLeft) then elseif key.down(keyLeft) or pad.down(btnLeft) then
abad.update=abad_state_walking abad.update=abad_state_walking
abad.flip=true abad.flip=true
elseif btn(keyJump) or pad(btnJump) then elseif key.down(keyJump) or pad.down(btnJump) then
abad.update=abad_state_jumping abad.update=abad_state_jumping
abad.step=0 abad.step=0
abad.jumpfwd=false abad.jumpfwd=false
if abad.jump then if abad.jump then
stopsound(abad.jump) sound.stop(abad.jump)
abad.jump=nil abad.jump=nil
end end
playsnd(audio_abad_jump) playsnd(audio_abad_jump)
elseif btn(keyDown) or pad(btnDown) then elseif key.down(keyDown) or pad.down(btnDown) then
abad.update=abad_state_crouch abad.update=abad_state_crouch
--elseif btn(KEY_Z) then --elseif btn(KEY_Z) then
-- abad.respawning=240 -- abad.respawning=240
elseif btn(keyShoot) or pad(btnShoot) and cacau.hab==-1 then elseif key.down(keyShoot) or pad.down(btnShoot) and cacau.hab==-1 then
playsnd(audio_abad_shot) playsnd(audio_abad_shot)
abad.update=abad_state_fire abad.update=abad_state_fire
abad.wait=0 abad.wait=0
@@ -118,7 +118,7 @@ function abad_state_crouch()
abad.step=0 abad.step=0
abad.jumpfwd=false abad.jumpfwd=false
if not (btn(keyDown) or pad(btnDown)) then if not (key.down(keyDown) or pad.down(btnDown)) then
abad.update=abad_state_normal abad.update=abad_state_normal
abad.bb.y=0 abad.bb.y=0
abad.bb.h=16 abad.bb.h=16
@@ -187,28 +187,28 @@ function abad_state_walking()
abad_make_safe() abad_make_safe()
if btn(keyJump) or pad(btnJump) then if key.down(keyJump) or pad.down(btnJump) then
abad.update=abad_state_jumping abad.update=abad_state_jumping
abad.step=0 abad.step=0
abad.jumpfwd=true abad.jumpfwd=true
if abad.jump then if abad.jump then
stopsound(abad.jump) sound.stop(abad.jump)
abad.jump=nil abad.jump=nil
end end
playsnd(audio_abad_jump) playsnd(audio_abad_jump)
return return
elseif btn(keyDown) or pad(btnDown) then elseif key.down(keyDown) or pad.down(btnDown) then
abad.update=abad_state_crouch abad.update=abad_state_crouch
elseif btn(keyShoot) or pad(btnShoot) and cacau.hab==-1 then elseif key.down(keyShoot) or pad.down(btnShoot) and cacau.hab==-1 then
playsnd(audio_abad_shot) playsnd(audio_abad_shot)
abad.update=abad_state_fire abad.update=abad_state_fire
abad.wait=0 abad.wait=0
cacau.init(abad.hab,abad.x+8,abad.y+8,abad.flip) cacau.init(abad.hab,abad.x+8,abad.y+8,abad.flip)
end end
if btn(keyRight) or pad(btnRight) then if key.down(keyRight) or pad.down(btnRight) then
abad.flip=false abad.flip=false
elseif btn(keyLeft) or pad(btnLeft) then elseif key.down(keyLeft) or pad.down(btnLeft) then
abad.flip=true abad.flip=true
elseif abad.wait==0 then elseif abad.wait==0 then
abad.update=abad_state_normal abad.update=abad_state_normal
@@ -299,15 +299,15 @@ function abad_state_stairs()
if abad.wait==6 then if abad.wait==6 then
abad.wait=0 abad.wait=0
if btn(keyRight) or pad(btnRight) then if key.down(keyRight) or pad.down(btnRight) then
abad.flip=false abad.flip=false
abad_advance() abad_advance()
playsnd(audio_low) playsnd(audio_low)
elseif btn(keyLeft) or pad(btnLeft) then elseif key.down(keyLeft) or pad.down(btnLeft) then
abad.flip=true abad.flip=true
abad_advance() abad_advance()
playsnd(audio_low) playsnd(audio_low)
elseif btn(keyUp) or pad(btnUp) then elseif key.down(keyUp) or pad.down(btnUp) then
if abad.y>0 then if abad.y>0 then
if check_tile(abad.hab,abad.x+4,abad.y+8)==tiletype.stair or (abad.x+4)&7~=0 and check_tile(abad.hab,abad.x+12,abad.y+8)==tiletype.stair then if check_tile(abad.hab,abad.x+4,abad.y+8)==tiletype.stair or (abad.x+4)&7~=0 and check_tile(abad.hab,abad.x+12,abad.y+8)==tiletype.stair then
abad.y=abad.y-2 abad.y=abad.y-2
@@ -318,7 +318,7 @@ function abad_state_stairs()
imp.reset() imp.reset()
abad.y=32 abad.y=32
end end
elseif btn(keyDown) or pad(btnDown) then elseif key.down(keyDown) or pad.down(btnDown) then
if abad.y<32 then if abad.y<32 then
if check_tile(abad.hab,abad.x+4,abad.y+16)==tiletype.stair or (abad.x+4)&7~=0 and check_tile(abad.hab,abad.x+12,abad.y+16)==tiletype.stair then if check_tile(abad.hab,abad.x+4,abad.y+16)==tiletype.stair or (abad.x+4)&7~=0 and check_tile(abad.hab,abad.x+12,abad.y+16)==tiletype.stair then
abad.y=abad.y+2 abad.y=abad.y+2

View File

@@ -44,7 +44,7 @@ end
function bambolla.draw_normal() function bambolla.draw_normal()
if bambolla.enabled then if bambolla.enabled then
blit(112,16,16,16,bambolla.x,bambolla.y,16,16) draw.surf(112,16,16,16,bambolla.x,bambolla.y,16,16)
end end
end end
@@ -58,7 +58,7 @@ function bambolla.update_normal()
bambolla.wait=0 bambolla.wait=0
if not bambolla.enabled then if not bambolla.enabled then
bambolla.counter=bambolla.counter-1 bambolla.counter=bambolla.counter-1
local r = rnd(bambolla.counter) local r = math.random(0,bambolla.counter-1)
--print(r) --print(r)
if bambolla.counter==1 or r==1 then if bambolla.counter==1 or r==1 then
bambolla.init() bambolla.init()
@@ -109,14 +109,14 @@ bambolla.update=bambolla.update_normal
bambolla.draw=bambolla.draw_normal bambolla.draw=bambolla.draw_normal
function bambolla.draw_splash() function bambolla.draw_splash()
circfill(bambolla.cx+bambolla.dx,bambolla.y,2,16) draw.circf(bambolla.cx+bambolla.dx,bambolla.y,2,16)
circfill(bambolla.cx+bambolla.dx,bambolla.y,1,6) draw.circf(bambolla.cx+bambolla.dx,bambolla.y,1,6)
circfill(bambolla.cx-bambolla.dx,bambolla.y,2,16) draw.circf(bambolla.cx-bambolla.dx,bambolla.y,2,16)
circfill(bambolla.cx-bambolla.dx,bambolla.y,1,6) draw.circf(bambolla.cx-bambolla.dx,bambolla.y,1,6)
circfill(bambolla.cx-(bambolla.dx/2),bambolla.y-4,2,16) draw.circf(bambolla.cx-(bambolla.dx/2),bambolla.y-4,2,16)
circfill(bambolla.cx-(bambolla.dx/2),bambolla.y-4,1,6) draw.circf(bambolla.cx-(bambolla.dx/2),bambolla.y-4,1,6)
circfill(bambolla.cx+(bambolla.dx/2),bambolla.y-4,2,16) draw.circf(bambolla.cx+(bambolla.dx/2),bambolla.y-4,2,16)
circfill(bambolla.cx+(bambolla.dx/2),bambolla.y-4,1,6) draw.circf(bambolla.cx+(bambolla.dx/2),bambolla.y-4,1,6)
end end
function bambolla.update_splash() function bambolla.update_splash()

View File

@@ -5,7 +5,7 @@ function batman.init()
batman.update=batman.update_normal batman.update=batman.update_normal
batman.draw=batman.draw batman.draw=batman.draw
local habs={5,9,46,36,18} local habs={5,9,46,36,18}
batman.hab=habs[1+rnd(#habs)] batman.hab=habs[1+math.random(0,#habs-1)]
batman.x=24 batman.x=24
batman.y=24 batman.y=24
end end
@@ -15,7 +15,7 @@ function batman.draw()
if batman.update==batman.update_stairs then if batman.update==batman.update_stairs then
flip=(((batman.x>>1)+(batman.y>>1))%2)==0 flip=(((batman.x>>1)+(batman.y>>1))%2)==0
end end
blit((batman.frame&7)*16,(batman.frame>>3)*16,16,16,batman.x,batman.y,16,16,flip) draw.surf((batman.frame&7)*16,(batman.frame>>3)*16,16,16,batman.x,batman.y,16,16,flip)
end end
function batman.hit() function batman.hit()
@@ -58,7 +58,7 @@ function batman.update_normal()
batman.x=84 batman.x=84
end end
elseif check_tile(batman.hab,batman.x+inc,batman.y+6)<tiletype.half then elseif check_tile(batman.hab,batman.x+inc,batman.y+6)<tiletype.half then
local r=rnd(2) local r=math.random(0,1)
if check_tile(batman.hab,batman.x+inc,batman.y+14)==tiletype.block then r=0 end if check_tile(batman.hab,batman.x+inc,batman.y+14)==tiletype.block then r=0 end
if batman.stepscooldown>0 and check_tile(batman.hab,batman.x+inc,batman.y+14)==tiletype.half then r=batman.stepsremember end if batman.stepscooldown>0 and check_tile(batman.hab,batman.x+inc,batman.y+14)==tiletype.half then r=batman.stepsremember end
if r==0 then if r==0 then
@@ -90,7 +90,7 @@ function batman.update_normal()
if batman.stairscooldown==0 and if batman.stairscooldown==0 and
check_tile(batman.hab,batman.x+6,batman.y+8)==tiletype.stair and check_tile(batman.hab,batman.x+6,batman.y+8)==tiletype.stair and
check_tile(batman.hab,batman.x+14,batman.y+8)==tiletype.stair then check_tile(batman.hab,batman.x+14,batman.y+8)==tiletype.stair then
if rnd(10)<8 then if math.random(0,9)<8 then
batman.update=batman.update_stairs batman.update=batman.update_stairs
if check_tile(batman.hab,batman.x+4,batman.y+16)==tiletype.block then if check_tile(batman.hab,batman.x+4,batman.y+16)==tiletype.block then
batman.goup=true batman.goup=true
@@ -108,7 +108,7 @@ function batman.update_normal()
end end
if check_tile(batman.hab,batman.x+4,batman.y+16)==tiletype.void and ((batman.x+4)&7==0 or check_tile(batman.hab,batman.x+12,batman.y+16)==tiletype.void) then if check_tile(batman.hab,batman.x+4,batman.y+16)==tiletype.void and ((batman.x+4)&7==0 or check_tile(batman.hab,batman.x+12,batman.y+16)==tiletype.void) then
local option=rnd(2) local option=math.random(0,1)
if batman.stairscooldown>0 then option=0 end if batman.stairscooldown>0 then option=0 end
if option==0 then if option==0 then
batman.update=batman.update_falling batman.update=batman.update_falling
@@ -221,7 +221,7 @@ function batman.update_stairs()
batman.y=batman.y-2 batman.y=batman.y-2
else else
batman.update=batman.update_normal batman.update=batman.update_normal
if rnd(3)>0 then batman.flip=not batman.flip end if math.random(0,2)>0 then batman.flip=not batman.flip end
batman.stairscooldown=50 batman.stairscooldown=50
end end
else else
@@ -234,7 +234,7 @@ function batman.update_stairs()
batman.y=batman.y+2 batman.y=batman.y+2
else else
batman.update=batman.update_normal batman.update=batman.update_normal
if rnd(3)>0 then batman.flip=not batman.flip end if math.random(0,2)>0 then batman.flip=not batman.flip end
batman.stairscooldown=50 batman.stairscooldown=50
end end
else else

View File

@@ -6,7 +6,7 @@ function bol.init()
end end
function bol.draw() function bol.draw()
blit(112,88,16,8,bol.x,bol.y,16,8) draw.surf(112,88,16,8,bol.x,bol.y,16,8)
end end
function bol.update() function bol.update()

View File

@@ -8,12 +8,12 @@ function cacau.init(_hab,_x,_y,_flip)
cacau.flip=_flip cacau.flip=_flip
end end
function cacau:draw() function cacau.draw()
circfill(cacau.x,cacau.y,2,16) draw.circf(cacau.x,cacau.y,2,16)
circfill(cacau.x,cacau.y,1,6) draw.circf(cacau.x,cacau.y,1,6)
end end
function cacau:update() function cacau.update()
if cacau.hab == -1 then return end if cacau.hab == -1 then return end
cacau.wait=cacau.wait+1 cacau.wait=cacau.wait+1

View File

@@ -5,7 +5,7 @@ function caco.new(_hab,_x,_y,_flip)
end end
function caco:draw() function caco:draw()
if self.frame>0 then blit((self.frame&7)*16,(self.frame>>3)*16,16,16,self.x,self.y,16,16,self.flip) end if self.frame>0 then draw.surf((self.frame&7)*16,(self.frame>>3)*16,16,16,self.x,self.y,16,16,self.flip) end
end end
function caco:update_normal() function caco:update_normal()

View File

@@ -6,7 +6,7 @@ function dead.start()
dead.vel={} dead.vel={}
for i=1,128 do for i=1,128 do
dead.pos[i]=0 dead.pos[i]=0
dead.vel[i]=(200+rnd(400))/400 dead.vel[i]=(200+math.random(0,399))/400
end end
game_update=dead.update game_update=dead.update
end end
@@ -16,30 +16,30 @@ function dead.update()
for i=1,128 do for i=1,128 do
if dead.pos[i]<96 then if dead.pos[i]<96 then
dead.pos[i]=dead.pos[i]+dead.vel[i] dead.pos[i]=dead.pos[i]+dead.vel[i]
vline(i-1,0,dead.pos[i],16) draw.vline(i-1,0,dead.pos[i],16)
end end
end end
if dead.count>50 then if dead.count>50 then
if dead.count>130 then if dead.count>130 then
prnt("GAME OVER",44,40,2) draw.text("GAME OVER",44,40,2)
elseif dead.count>120 then elseif dead.count>120 then
prnt("GAME OVE",44,40,2) draw.text("GAME OVE",44,40,2)
elseif dead.count>110 then elseif dead.count>110 then
prnt("GAME OV",44,40,2) draw.text("GAME OV",44,40,2)
elseif dead.count>100 then elseif dead.count>100 then
prnt("GAME O",44,40,2) draw.text("GAME O",44,40,2)
elseif dead.count>90 then elseif dead.count>90 then
prnt("GAME",44,40,2) draw.text("GAME",44,40,2)
elseif dead.count>80 then elseif dead.count>80 then
prnt("GAM",44,40,2) draw.text("GAM",44,40,2)
elseif dead.count>70 then elseif dead.count>70 then
prnt("GA",44,40,2) draw.text("GA",44,40,2)
elseif dead.count>60 then elseif dead.count>60 then
prnt("G",44,40,2) draw.text("G",44,40,2)
end end
end end
if (dead.count>250 and (btnp(keyShoot) or padp(btnShoot))) or dead.count>500 then if (dead.count>250 and (key.press(keyShoot) or pad.press(btnShoot))) or dead.count>500 then
game_exit() game_exit()
game_init(true) game_init(true)
end end

View File

@@ -11,7 +11,7 @@ function elalien.init()
elalien.scene_intro=false elalien.scene_intro=false
elalien.scene_object=false elalien.scene_object=false
local habs={66,56,59,53} local habs={66,56,59,53}
elalien.hab=habs[1+rnd(4)] elalien.hab=habs[1+math.random(0,3)]
end end
function elalien.draw() function elalien.draw()
@@ -19,7 +19,7 @@ function elalien.draw()
if elalien.update==elalien.update_stairs then if elalien.update==elalien.update_stairs then
flip=(((elalien.x>>1)+(elalien.y>>1))%2)==0 flip=(((elalien.x>>1)+(elalien.y>>1))%2)==0
end end
blit((elalien.frame&7)*16,(elalien.frame>>3)*16,16,16,elalien.x,elalien.y,16,16,flip) draw.surf((elalien.frame&7)*16,(elalien.frame>>3)*16,16,16,elalien.x,elalien.y,16,16,flip)
end end
function elalien.hit() function elalien.hit()
@@ -56,7 +56,7 @@ function elalien.update_normal()
elalien.x=84 elalien.x=84
end end
elseif check_tile(elalien.hab,elalien.x+inc,elalien.y+6)<tiletype.half then elseif check_tile(elalien.hab,elalien.x+inc,elalien.y+6)<tiletype.half then
local r=rnd(2) local r=math.random(0,1)
if check_tile(elalien.hab,elalien.x+inc,elalien.y+14)==tiletype.block then r=0 end if check_tile(elalien.hab,elalien.x+inc,elalien.y+14)==tiletype.block then r=0 end
if r==0 then if r==0 then
elalien.update=elalien.update_jumping elalien.update=elalien.update_jumping
@@ -83,7 +83,7 @@ function elalien.update_normal()
if elalien.stairscooldown==0 and if elalien.stairscooldown==0 and
check_tile(elalien.hab,elalien.x+6,elalien.y+8)==tiletype.stair and check_tile(elalien.hab,elalien.x+6,elalien.y+8)==tiletype.stair and
check_tile(elalien.hab,elalien.x+14,elalien.y+8)==tiletype.stair then check_tile(elalien.hab,elalien.x+14,elalien.y+8)==tiletype.stair then
if rnd(10)<8 then if math.random(0,9)<8 then
elalien.update=elalien.update_stairs elalien.update=elalien.update_stairs
if check_tile(elalien.hab,elalien.x+4,elalien.y+16)==tiletype.block then if check_tile(elalien.hab,elalien.x+4,elalien.y+16)==tiletype.block then
elalien.goup=true elalien.goup=true
@@ -101,7 +101,7 @@ function elalien.update_normal()
end end
if check_tile(elalien.hab,elalien.x+4,elalien.y+16)==tiletype.void and ((elalien.x+4)&7==0 or check_tile(elalien.hab,elalien.x+12,elalien.y+16)==tiletype.void) then if check_tile(elalien.hab,elalien.x+4,elalien.y+16)==tiletype.void and ((elalien.x+4)&7==0 or check_tile(elalien.hab,elalien.x+12,elalien.y+16)==tiletype.void) then
local option=rnd(2) local option=math.random(0,1)
if elalien.stairscooldown>0 then option=0 end if elalien.stairscooldown>0 then option=0 end
if option==0 then if option==0 then
elalien.update=elalien.update_falling elalien.update=elalien.update_falling
@@ -229,7 +229,7 @@ function elalien.update_stairs()
elalien.y=elalien.y-2 elalien.y=elalien.y-2
else else
elalien.update=elalien.update_normal elalien.update=elalien.update_normal
if rnd(3)>0 then elalien.flip=not elalien.flip end if math.random(0,2)>0 then elalien.flip=not elalien.flip end
elalien.stairscooldown=50 elalien.stairscooldown=50
end end
else else
@@ -242,7 +242,7 @@ function elalien.update_stairs()
elalien.y=elalien.y+2 elalien.y=elalien.y+2
else else
elalien.update=elalien.update_normal elalien.update=elalien.update_normal
if rnd(3)>0 then elalien.flip=not elalien.flip end if math.random(0,2)>0 then elalien.flip=not elalien.flip end
elalien.stairscooldown=50 elalien.stairscooldown=50
end end
else else

View File

@@ -8,7 +8,7 @@ fade = {
init = function() init = function()
for i=1,15 do for i=1,15 do
local r,g,b=palcolor(i) local r,g,b=pal.color(i)
fade.pal[i]={r,g,b} fade.pal[i]={r,g,b}
end end
end, end,
@@ -48,9 +48,9 @@ fade = {
local v=fade.getstep(i,fade.step) local v=fade.getstep(i,fade.step)
--print(v) --print(v)
if v==16 then if v==16 then
palcolor(i,0,0,0) pal.color(i,0,0,0)
else else
palcolor(i,fade.pal[v][1],fade.pal[v][2],fade.pal[v][3]) pal.color(i,fade.pal[v][1],fade.pal[v][2],fade.pal[v][3])
end end
end end
fade.step=fade.step+1 fade.step=fade.step+1
@@ -70,7 +70,7 @@ fade = {
game_update=fade.update_fadein game_update=fade.update_fadein
fade.wait=0 fade.wait=0
fade.step=6 fade.step=6
for i=1,15 do palcolor(i,0,0,0) end for i=1,15 do pal.color(i,0,0,0) end
end, end,
update_fadein=function() update_fadein=function()
@@ -84,9 +84,9 @@ fade = {
local v=fade.getstep(i,fade.step) local v=fade.getstep(i,fade.step)
--print(v) --print(v)
if v==16 then if v==16 then
palcolor(i,0,0,0) pal.color(i,0,0,0)
else else
palcolor(i,fade.pal[v][1],fade.pal[v][2],fade.pal[v][3]) pal.color(i,fade.pal[v][1],fade.pal[v][2],fade.pal[v][3])
end end
end end
fade.step=fade.step-1 fade.step=fade.step-1

View File

@@ -9,34 +9,34 @@ function final_init()
game_update=update_final game_update=update_final
next_actor() next_actor()
playmus(audio_final) playmus(audio_final)
local r,g,b=palcolor(15) local r,g,b=pal.color(15)
palcolor(17,r,g,b) pal.color(17,r,g,b)
--fade.fadein() --fade.fadein()
end end
go_next_actor=false go_next_actor=false
function update_final() function update_final()
cls(16) surf.cls(16)
camera(-16,-41) view.origin(16,41)
mapa_draw(final_room) mapa_draw(final_room)
draw_actor() draw_actor()
camera(0,0) view.origin(0,0)
rectfill(0,0,14,96,16) draw.rectf(0,0,15,97,16)
rectfill(114,0,191,96,16) draw.rectf(114,0,78,97,16)
rect(15,40,113,89,2) draw.rect(15,40,99,50,2)
text("C A C A U S", 42, 12, 17) text("C A C A U S", 42, 12, 17)
text(actor.name, 64-(#actor.name*2), 28, 11) text(actor.name, 64-(#actor.name*2), 28, 11)
mapa_update(abad.hab,final_room) mapa_update(abad.hab,final_room)
if btnp(KEY_M) then if key.press(key.M) then
mute = not mute mute = not mute
if mute then if mute then
stopmusic() music.stop()
else else
playmus(audio_final) playmus(audio_final)
end end
@@ -92,7 +92,7 @@ function draw_actor()
end end
end end
local tpl=128/actor.w local tpl=128/actor.w
blit((actor.frame%tpl)*actor.w,math.floor(actor.frame/tpl)*actor.h,actor.w,actor.h,actor.x,actor.y,actor.w,actor.h,actor.flip) draw.surf((actor.frame%tpl)*actor.w,math.floor(actor.frame/tpl)*actor.h,actor.w,actor.h,actor.x,actor.y,actor.w,actor.h,actor.flip)
end end
function next_actor() function next_actor()
@@ -136,21 +136,21 @@ function next_actor()
end end
function update_final2() function update_final2()
cls(16) surf.cls(16)
text("C A C A U S", 42, 12, 17) text("C A C A U S", 42, 12, 17)
text("GRACIES PER JUGAR", 30, 48, 10) text("GRACIES PER JUGAR", 30, 48, 10)
if btnp(KEY_M) then if key.press(key.M) then
mute = not mute mute = not mute
if mute then if mute then
stopmusic() music.stop()
else else
playmus(audio_final) playmus(audio_final)
end end
end end
final_count=final_count+1 final_count=final_count+1
if final_count==200 or (btnp(keyShoot) or padp(btnShoot)) or btnp(KEY_RETURN) then if final_count==200 or (key.press(keyShoot) or pad.press(btnShoot)) or key.press(key.RETURN) then
game_exit() game_exit()
game_init(true) game_init(true)
fade.fadeoutin() fade.fadeoutin()

View File

@@ -8,13 +8,13 @@ function fireball.init(_hab,_x,_y,_flip)
fireball.flip=_flip fireball.flip=_flip
end end
function fireball:draw() function fireball.draw()
circfill(fireball.x,fireball.y,3,16) draw.circf(fireball.x,fireball.y,3,16)
circfill(fireball.x,fireball.y,2,3) draw.circf(fireball.x,fireball.y,2,3)
circfill(fireball.x,fireball.y,1,8) draw.circf(fireball.x,fireball.y,1,8)
end end
function fireball:update() function fireball.update()
if fireball.hab == -1 then return end if fireball.hab == -1 then return end
fireball.wait=fireball.wait+1 fireball.wait=fireball.wait+1

View File

@@ -3,4 +3,3 @@ config=cacaus
width=128 width=128
height=96 height=96
zoom=5 zoom=5
files=final.lua,fade.lua,audio.lua,dead.lua,scenes.lua,trigger.lua,score.lua,switches.lua,map.lua,mapa.lua,bol.lua,invisibl.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,intro.lua,game.lua,main.lua

View File

@@ -40,14 +40,14 @@ end
function playmus(song,loop) function playmus(song,loop)
if not mute then if not mute then
playmusic(song,loop) music.play(song,loop)
end end
end end
function playsnd(sound,volume) function playsnd(snd,volume)
if not mute then if not mute then
--print(sound) --print(sound)
return playsound(sound,volume) return sound.play(snd,volume)
end end
end end
@@ -156,17 +156,17 @@ function game_init(menu)
game_update=update_menu game_update=update_menu
menu_count=0 menu_count=0
menu_change_room=300 menu_change_room=300
menu_room=rnd(60) menu_room=math.random(0,59)
playmus(audio_main_song) playmus(audio_main_song)
else else
game_update=update_game game_update=update_game
stopmusic() music.stop()
end end
--fade.fadein() --fade.fadein()
end end
function draw_hab(hab,x,y,editing) function draw_hab(hab,x,y,editing)
camera(-x,-y) view.origin(x,y)
mapa_draw(hab) mapa_draw(hab)
if not editing then if not editing then
@@ -180,19 +180,19 @@ function draw_hab(hab,x,y,editing)
if cacau.hab==hab then cacau:draw() end if cacau.hab==hab then cacau:draw() end
if fireball.hab==hab then fireball:draw() end if fireball.hab==hab then fireball:draw() end
end end
camera(0,0) view.origin(0,0)
end end
function update_dialog() function update_dialog()
rectfill(16,16,112,50,12) draw.rectf(16,16,97,35,12)
rect(15,15,113,51,16) draw.rect(15,15,99,37,16)
text("Save the map?",20,20,2) text("Save the map?",20,20,2)
text("This cannot be undone",20,27,2) text("This cannot be undone",20,27,2)
text("(Y)es (N)o",25,40,2) text("(Y)es (N)o",25,40,2)
if btnp(KEY_N) then if key.press(key.N) then
game_update=update_game game_update=update_game
elseif btnp(KEY_Y) then elseif key.press(key.Y) then
mapa_save() mapa_save()
game_update=update_game game_update=update_game
end end
@@ -200,63 +200,62 @@ end
scroll=0 scroll=0
function update_game() function update_game()
cls(16) surf.cls(16)
if mode==modes.editing then if mode==modes.editing then
draw_hab(abad.hab,0,0,true) draw_hab(abad.hab,0,0,true)
text(abad.hab,120,1,2) text(abad.hab,120,1,2)
blit(0,64+scroll*8,128,48,0,48) draw.surf(0,64+scroll*8,128,48,0,48)
color(3)
local xx=(seltile&15)*8 local xx=(seltile&15)*8
local yy=48+(seltile>>4)*8 local yy=48+(seltile>>4)*8
rect(xx,yy,xx+8,yy+8) draw.rect(xx,yy,9,9, 3)
text("EDIT",100,1,3) text("EDIT",100,1,3)
local hx = abad.hab%10 local hx = abad.hab%10
local hy = math.floor(abad.hab/10) local hy = math.floor(abad.hab/10)
scroll=0 scroll=0
if btnp(KEY_RIGHT) and hx<9 then if key.press(key.RIGHT) and hx<9 then
abad.hab=abad.hab+1 abad.hab=abad.hab+1
elseif btnp(KEY_LEFT) and hx>0 then elseif key.press(key.LEFT) and hx>0 then
abad.hab=abad.hab-1 abad.hab=abad.hab-1
elseif btnp(KEY_DOWN) and hy<7 then elseif key.press(key.DOWN) and hy<7 then
abad.hab=abad.hab+10 abad.hab=abad.hab+10
elseif btnp(KEY_UP) and hy>0 then elseif key.press(key.UP) and hy>0 then
abad.hab=abad.hab-10 abad.hab=abad.hab-10
elseif btnp(KEY_RETURN) then elseif key.press(key.RETURN) then
mode=modes.playing mode=modes.playing
elseif btnp(KEY_S) and (btn(KEY_LCTRL) or btn(KEY_LGUI)) then elseif key.press(key.S) and (key.down(key.LCTRL) or key.down(key.LGUI)) then
game_update=update_dialog game_update=update_dialog
elseif btnp(KEY_C) then elseif key.press(key.C) then
mapa_cycle_colors(abad.hab) mapa_cycle_colors(abad.hab)
elseif btnp(KEY_M) then elseif key.press(key.M) then
mapa_create_minimap() mapa_create_minimap()
return return
end end
if btn(KEY_TAB) then if key.down(key.TAB) then
scroll=2 scroll=2
end end
local mx,my=mousex(),mousey() local mx,my=mouse.pos()
if mx>>3 < 12 and my>>3 < 6 then if mx>>3 < 12 and my>>3 < 6 then
text(mx>>3,100,10,2) text(mx>>3,100,10,2)
text(my>>3,111,10,2) text(my>>3,111,10,2)
text((mx>>3)+(my>>3)*12,118,10,2) text((mx>>3)+(my>>3)*12,118,10,2)
end end
if mbtn(1) then if mouse.down(mouse.LEFT) then
if my>=48 then if my>=48 then
seltile=(mx>>3)+((my-48+(scroll*8))>>3)*16 seltile=(mx>>3)+((my-48+(scroll*8))>>3)*16
elseif mx<96 then elseif mx<96 then
mapa_set_tile(abad.hab,mx>>3,my>>3,seltile) mapa_set_tile(abad.hab,mx>>3,my>>3,seltile)
end end
elseif mbtn(3) then elseif mouse.down(mouse.RIGHT) then
if my<48 and mx<96 then if my<48 and mx<96 then
mapa_set_tile(abad.hab,mx>>3,my>>3,256) mapa_set_tile(abad.hab,mx>>3,my>>3,256)
end end
end end
if mx>>3 < 12 and my>>3 < 6 then if mx>>3 < 12 and my>>3 < 6 then
local tx,ty=(mx>>3)<<3,(my>>3)<<3 local tx,ty=(mx>>3)<<3,(my>>3)<<3
rect(tx,ty,tx+8,ty+8,3) draw.rect(tx,ty,9,9,3)
end end
else else
if abad.hurting == 0 then if abad.hurting == 0 then
@@ -266,15 +265,15 @@ function update_game()
text(camera_names[current_camera],2,49,8) text(camera_names[current_camera],2,49,8)
score.draw() score.draw()
setsource(tiles) surf.source(tiles)
prnt("x"..abad.vides,114,13,2) draw.text("x"..abad.vides,114,13,2)
rectfill(102+(abad.energia>>1),30,122,37,16) draw.rectf(102+(abad.energia>>1),30,21-(abad.energia>>1),8,16)
else else
blit(0,0,16,9,50,40,16,9,true) draw.surf(0,0,16,9,50,40,16,9,true)
if abad.hurting > 40 then if abad.hurting > 40 then
prnt("x"..abad.vides+1,63,43,3) draw.text("x"..abad.vides+1,63,43,3)
elseif abad.hurting < 20 then elseif abad.hurting < 20 then
prnt("x"..abad.vides,63,43,2) draw.text("x"..abad.vides,63,43,2)
end end
end end
@@ -315,27 +314,27 @@ function update_game()
--elseif btnp(KEY_ESCAPE) then --elseif btnp(KEY_ESCAPE) then
-- pause() -- pause()
--end --end
if btnp(KEY_ESCAPE) or padp(btnPause) then if key.press(key.ESCAPE) or pad.press(btnPause) then
pause() pause()
end end
if abad.objects.gps~=nil then if abad.objects.gps~=nil then
if btnp(KEY_1) then if key.press(key.N1) then
if abad.objects.gorro==nil and abad.objects.clau_premiere==nil then current_camera=1 end if abad.objects.gorro==nil and abad.objects.clau_premiere==nil then current_camera=1 end
elseif btnp(KEY_2) then elseif key.press(key.N2) then
if abad.objects.peu==nil and abad.objects.clau_elalien==nil then current_camera=2 end if abad.objects.peu==nil and abad.objects.clau_elalien==nil then current_camera=2 end
elseif btnp(KEY_3) then elseif key.press(key.N3) then
current_camera=3 current_camera=3
elseif btnp(KEY_4) then elseif key.press(key.N4) then
current_camera=4 current_camera=4
elseif btnp(KEY_5) then elseif key.press(key.N5) then
current_camera=5 current_camera=5
end end
if padp(btnCycle1) then if pad.press(btnCycle1) then
current_camera=current_camera+1 current_camera=current_camera+1
if current_camera==6 then current_camera=1 end 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==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 if current_camera==2 and (abad.objects.peu or abad.objects.clau_elalien) then current_camera=3 end
elseif padp(btnCycle2) then elseif pad.press(btnCycle2) then
current_camera=current_camera-1 current_camera=current_camera-1
if current_camera==0 then current_camera=5 end 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==2 and (abad.objects.peu or abad.objects.clau_elalien) then current_camera=1 end
@@ -347,9 +346,9 @@ end
function redraw_menu_hab() function redraw_menu_hab()
draw_hab(menu_room,16,41) draw_hab(menu_room,16,41)
rectfill(0,0,14,96,16) draw.rectf(0,0,15,97,16)
rectfill(114,0,191,96,16) draw.rectf(114,0,78,97,16)
rect(15,40,113,89,2) draw.rect(15,40,99,50,2)
mapa_update(abad.hab,menu_room) mapa_update(abad.hab,menu_room)
for key,actor in pairs(actors) do for key,actor in pairs(actors) do
@@ -365,11 +364,11 @@ end
function update_menu() function update_menu()
menu_change_room=menu_change_room-1 menu_change_room=menu_change_room-1
if menu_change_room==0 then if menu_change_room==0 then
menu_room = rnd(60) menu_room = math.random(0,59)
menu_change_room=300 menu_change_room=300
end end
cls(16) surf.cls(16)
text("C A C A U S", 42, 8, 15) text("C A C A U S", 42, 8, 15)
if menu_state == 0 then if menu_state == 0 then
@@ -385,7 +384,7 @@ function update_menu()
redraw_menu_hab() redraw_menu_hab()
if btnp(keyShoot) or btnp(KEY_SPACE) or padp(BTN_A) or padp(btnShoot) then if key.press(keyShoot) or key.press(key.SPACE) or pad.press(pad.A) or pad.press(btnShoot) then
if menu_sel==0 then if menu_sel==0 then
game_exit() game_exit()
game_init() game_init()
@@ -397,130 +396,130 @@ function update_menu()
menu_count=0 menu_count=0
menu_state=2 menu_state=2
end end
elseif btnp(keyDown) or btnp(KEY_DOWN) or padp(BTN_DOWN) or padp(btnDown) then elseif key.press(keyDown) or key.press(key.DOWN) or pad.press(pad.DOWN) or pad.press(btnDown) then
menu_sel=menu_sel+1 menu_sel=menu_sel+1
if menu_sel==3 then menu_sel=0 end if menu_sel==3 then menu_sel=0 end
elseif btnp(keyUp) or btnp(KEY_UP) or padp(BTN_UP) or padp(btnUp) then elseif key.press(keyUp) or key.press(key.UP) or pad.press(pad.UP) or pad.press(btnUp) then
menu_sel=menu_sel-1 menu_sel=menu_sel-1
if menu_sel==-1 then menu_sel=2 end if menu_sel==-1 then menu_sel=2 end
elseif btnp(KEY_M) then elseif key.press(key.M) then
mute = not mute mute = not mute
if mute then if mute then
stopmusic() music.stop()
else else
playmus(audio_main_song) playmus(audio_main_song)
end end
elseif btnp(KEY_ESCAPE) or padp(btnPause) then elseif key.press(key.ESCAPE) or pad.press(btnPause) then
quit() sys.quit()
end end
elseif menu_state==1 then elseif menu_state==1 then
if btnp(KEY_ESCAPE) then if key.press(key.ESCAPE) then
menu_count = 0 menu_count = 0
menu_state = 0 menu_state = 0
end end
if menu_count==0 then if menu_count==0 then
text("PULSA TECLA PER A AMUNT", 20, 24, 13) text("PULSA TECLA PER A AMUNT", 20, 24, 13)
local key = btnp(); local k = key.press();
if key ~= 0 and key~=KEY_ESCAPE then if k ~= 0 and k~=key.ESCAPE then
menu_count = 1 menu_count = 1
keyUp=key keyUp=k
setconf("keyup", keyUp) config.key("keyup", keyUp)
end end
elseif menu_count==1 then elseif menu_count==1 then
text("PULSA TECLA PER A AVALL", 20, 24, 13) text("PULSA TECLA PER A AVALL", 20, 24, 13)
local key = btnp(); local k = key.press();
if key ~= 0 and key~=KEY_ESCAPE then if k ~= 0 and k~=key.ESCAPE then
menu_count = 2 menu_count = 2
keyDown=key keyDown=k
setconf("keydown", keyDown) config.key("keydown", keyDown)
end end
elseif menu_count==2 then elseif menu_count==2 then
text("PULSA TECLA PER A ESQUERRA", 14, 24, 13) text("PULSA TECLA PER A ESQUERRA", 14, 24, 13)
local key = btnp(); local k = key.press();
if key ~= 0 and key~=KEY_ESCAPE then if k ~= 0 and k~=key.ESCAPE then
menu_count = 3 menu_count = 3
keyLeft=key keyLeft=k
setconf("keleft", keyLeft) config.key("keleft", keyLeft)
end end
elseif menu_count==3 then elseif menu_count==3 then
text("PULSA TECLA PER A DRETA", 20, 24, 13) text("PULSA TECLA PER A DRETA", 20, 24, 13)
local key = btnp(); local k = key.press();
if key ~= 0 and key~=KEY_ESCAPE then if k ~= 0 and k~=key.ESCAPE then
menu_count = 4 menu_count = 4
keyRight=key keyRight=k
setconf("keyright", keyRight) config.key("keyright", keyRight)
end end
elseif menu_count==4 then elseif menu_count==4 then
text("PULSA TECLA PER A BOTAR", 20, 24, 13) text("PULSA TECLA PER A BOTAR", 20, 24, 13)
local key = btnp(); local k = key.press();
if key ~= 0 and key~=KEY_ESCAPE then if k ~= 0 and k~=key.ESCAPE then
menu_count = 5 menu_count = 5
keyJump=key keyJump=k
setconf("keyjump", keyJump) config.key("keyjump", keyJump)
end end
elseif menu_count==5 then elseif menu_count==5 then
text("PULSA TECLA PER A DISPAR", 18, 24, 13) text("PULSA TECLA PER A DISPAR", 18, 24, 13)
local key = btnp(); local k = key.press();
if key ~= 0 and key~=KEY_ESCAPE then if k ~= 0 and k~=key.ESCAPE then
menu_count = 0 menu_count = 0
menu_state = 0 menu_state = 0
keyShoot=key keyShoot=k
setconf("keyshoot", keyShoot) config.key("keyshoot", keyShoot)
end end
end end
else else
if btnp(KEY_ESCAPE) then if key.press(key.ESCAPE) then
menu_count = 0 menu_count = 0
menu_state = 0 menu_state = 0
end end
if menu_count==0 then if menu_count==0 then
text("PULSA BOTÓ PER A AMUNT", 22, 24, 13) text("PULSA BOTÓ PER A AMUNT", 22, 24, 13)
local btn = padp(); local btn = pad.press();
if btn ~= -1 then if btn ~= -1 then
menu_count = 1 menu_count = 1
btnUp=btn btnUp=btn
setconf("btnup", btnUp) config.key("btnup", btnUp)
end end
elseif menu_count==1 then elseif menu_count==1 then
text("PULSA BOTÓ PER A AVALL", 22, 24, 13) text("PULSA BOTÓ PER A AVALL", 22, 24, 13)
local btn = padp(); local btn = pad.press();
if btn ~= -1 then if btn ~= -1 then
menu_count = 2 menu_count = 2
btnDown=btn btnDown=btn
setconf("btndown", btnDown) config.key("btndown", btnDown)
end end
elseif menu_count==2 then elseif menu_count==2 then
text("PULSA BOTÓ PER A ESQUERRA", 16, 24, 13) text("PULSA BOTÓ PER A ESQUERRA", 16, 24, 13)
local btn = padp(); local btn = pad.press();
if btn ~= -1 then if btn ~= -1 then
menu_count = 3 menu_count = 3
btnLeft=btn btnLeft=btn
setconf("keleft", btnLeft) config.key("keleft", btnLeft)
end end
elseif menu_count==3 then elseif menu_count==3 then
text("PULSA BOTÓ PER A DRETA", 22, 24, 13) text("PULSA BOTÓ PER A DRETA", 22, 24, 13)
local btn = padp(); local btn = pad.press();
if btn ~= -1 then if btn ~= -1 then
menu_count = 4 menu_count = 4
btnRight=btn btnRight=btn
setconf("btnright", btnRight) config.key("btnright", btnRight)
end end
elseif menu_count==4 then elseif menu_count==4 then
text("PULSA BOTÓ PER A BOTAR", 22, 24, 13) text("PULSA BOTÓ PER A BOTAR", 22, 24, 13)
local btn = padp(); local btn = pad.press();
if btn ~= -1 then if btn ~= -1 then
menu_count = 5 menu_count = 5
btnJump=btn btnJump=btn
setconf("btnjump", btnJump) config.key("btnjump", btnJump)
end end
elseif menu_count==5 then elseif menu_count==5 then
text("PULSA BOTÓ PER A DISPAR", 20, 24, 13) text("PULSA BOTÓ PER A DISPAR", 20, 24, 13)
local btn = padp(); local btn = pad.press();
if btn ~= -1 then if btn ~= -1 then
menu_count = 0 menu_count = 0
menu_state = 0 menu_state = 0
btnShoot=btn btnShoot=btn
setconf("btnshoot", btnShoot) config.key("btnshoot", btnShoot)
end end
end end
end end
@@ -538,40 +537,40 @@ function aabb(a, b)
end end
function pause() function pause()
setsource(0) surf.source(0)
setdest(back) surf.target(back)
blit(0,0,128,96,0,0) draw.surf(0,0,128,96,0,0)
setdest(0) surf.target(0)
setsource(tiles) surf.source(tiles)
pausa_option=1 pausa_option=1
pause_old_update=game_update pause_old_update=game_update
game_update=update_pause game_update=update_pause
end end
function update_pause() function update_pause()
rectfill(16,16,112,80,16) draw.rectf(16,16,97,65,16)
rect(16,16,112,80,15) draw.rect(16,16,97,65,15)
prnt("PAUSA",54,30,15) draw.text("PAUSA",54,30,15)
if pausa_option==1 then if pausa_option==1 then
rect(28,48,100,56,13) draw.rect(28,48,73,9,13)
else else
rect(28,58,100,66,13) draw.rect(28,58,73,9,13)
end end
prnt("CONTINUAR",30,50,14) draw.text("CONTINUAR",30,50,14)
prnt("EIXIR",30,60,14) draw.text("EIXIR",30,60,14)
if btnp(KEY_ESCAPE) then if key.press(key.ESCAPE) then
setsource(back) surf.source(back)
blit(0,0,128,96,0,0) draw.surf(0,0,128,96,0,0)
setsource(tiles) surf.source(tiles)
game_update = pause_old_update game_update = pause_old_update
elseif btnp(keyDown) or btnp(keyUp) or padp(btnDown) or padp(btnUp) then elseif key.press(keyDown) or key.press(keyUp) or pad.press(btnDown) or pad.press(btnUp) then
if pausa_option==1 then pausa_option=2 else pausa_option=1 end if pausa_option==1 then pausa_option=2 else pausa_option=1 end
elseif btnp(keyShoot) or padp(btnShoot) then elseif key.press(keyShoot) or pad.press(btnShoot) then
if pausa_option==1 then if pausa_option==1 then
setsource(back) surf.source(back)
blit(0,0,128,96,0,0) draw.surf(0,0,128,96,0,0)
setsource(tiles) surf.source(tiles)
game_update = pause_old_update game_update = pause_old_update
else else
game_exit() game_exit()

View File

@@ -2,7 +2,7 @@ gorro={hab=5,x=48,y=24,bb={x=0,y=0,w=8,h=8}}
function gorro.init() function gorro.init()
local habs={{60,5},{4,5},{34,4},{62,7},{75,4}} local habs={{60,5},{4,5},{34,4},{62,7},{75,4}}
local r=1+rnd(#habs) local r=1+math.random(0,#habs-1)
gorro.hab=habs[r][1] gorro.hab=habs[r][1]
gorro.x=habs[r][2]*8 gorro.x=habs[r][2]*8
gorro.update=gorro.update gorro.update=gorro.update
@@ -10,7 +10,7 @@ function gorro.init()
end end
function gorro.draw() function gorro.draw()
blit(96,32,16,16,gorro.x,gorro.y,16,16) draw.surf(96,32,16,16,gorro.x,gorro.y,16,16)
end end
function gorro.update() function gorro.update()

View File

@@ -5,7 +5,7 @@ function gota.new(_hab,_x,_y,_freq)
end end
function gota:draw_normal() function gota:draw_normal()
blit(112,0,8,8,self.x,self.y) draw.surf(112,0,8,8,self.x,self.y)
end end
function gota:update_normal() function gota:update_normal()
@@ -46,14 +46,14 @@ function gota:hit()
end end
function gota:draw_splash() function gota:draw_splash()
circfill(self.cx+self.dx,self.y,2,16) draw.circf(self.cx+self.dx,self.y,2,16)
circfill(self.cx+self.dx,self.y,1,11) draw.circf(self.cx+self.dx,self.y,1,11)
circfill(self.cx-self.dx,self.y,2,16) draw.circf(self.cx-self.dx,self.y,2,16)
circfill(self.cx-self.dx,self.y,1,11) draw.circf(self.cx-self.dx,self.y,1,11)
circfill(self.cx-(self.dx/2),self.y-4,2,16) draw.circf(self.cx-(self.dx/2),self.y-4,2,16)
circfill(self.cx-(self.dx/2),self.y-4,1,11) draw.circf(self.cx-(self.dx/2),self.y-4,1,11)
circfill(self.cx+(self.dx/2),self.y-4,2,16) draw.circf(self.cx+(self.dx/2),self.y-4,2,16)
circfill(self.cx+(self.dx/2),self.y-4,1,11) draw.circf(self.cx+(self.dx/2),self.y-4,1,11)
end end
function gota:update_splash() function gota:update_splash()

View File

@@ -2,7 +2,7 @@ gps={hab=5,x=48,y=24,bb={x=0,y=0,w=8,h=8}}
function gps.init() function gps.init()
local habs={{33,8},{13,4},{51,9},{50,4},{42,7}} local habs={{33,8},{13,4},{51,9},{50,4},{42,7}}
local r=1+rnd(#habs) local r=1+math.random(0,#habs-1)
gps.hab=habs[r][1] gps.hab=habs[r][1]
gps.x=habs[r][2]*8 gps.x=habs[r][2]*8
gps.update=gps.update gps.update=gps.update
@@ -10,7 +10,7 @@ function gps.init()
end end
function gps.draw() function gps.draw()
blit(112,48,16,16,gps.x,gps.y,16,16) draw.surf(112,48,16,16,gps.x,gps.y,16,16)
end end
function gps.update() function gps.update()

View File

@@ -44,7 +44,7 @@ end
function imp.draw() function imp.draw()
if imp.enabled then if imp.enabled then
blit((imp.frame&7)*16,(imp.frame>>3)*16,16,16,imp.x,imp.y,16,16,imp.flip) draw.surf((imp.frame&7)*16,(imp.frame>>3)*16,16,16,imp.x,imp.y,16,16,imp.flip)
end end
end end
@@ -58,7 +58,7 @@ function imp.update()
imp.wait=0 imp.wait=0
if not imp.enabled then if not imp.enabled then
imp.counter=imp.counter-1 imp.counter=imp.counter-1
local r = rnd(imp.counter) local r = math.random(0,imp.counter-1)
--print(r) --print(r)
if imp.counter==1 or r==1 then if imp.counter==1 or r==1 then
imp.init() imp.init()

View File

@@ -9,14 +9,14 @@ intro_step=0
function intro_init() function intro_init()
game_update = intro_intro game_update = intro_intro
intro_wait=400 intro_wait=400
cls(16) surf.cls(16)
setdest(logo) surf.target(logo)
cls(16) surf.cls(16)
prnt("JAILGAMES",0,0,15) draw.text("JAILGAMES",0,0,15)
setdest(0) surf.target(0)
setsource(logo) surf.source(logo)
blit(0,0,36,5,28,35,72,10) draw.surf(0,0,36,5,28,35,72,10)
setsource(tiles) surf.source(tiles)
fade.fadein() fade.fadein()
end end
@@ -24,74 +24,74 @@ 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) or padp(btnPause) then if intro_wait==0 or key.press(key.ESCAPE) or key.press(keyShoot) or pad.press(btnShoot) or pad.press(btnPause) then
intro_wait=1 intro_wait=1
game_update = intro_update game_update = intro_update
fade.fadeoutin() fade.fadeoutin()
end end
if btnp(KEY_M) then if key.press(key.M) then
mute = not mute mute = not mute
end end
end end
function intro_update() function intro_update()
if btnp(KEY_ESCAPE) or padp(btnPause) then if key.press(key.ESCAPE) or pad.press(btnPause) then
game_init(true) game_init(true)
fade.fadeoutin() fade.fadeoutin()
elseif btnp(KEY_SPACE) then elseif key.press(key.SPACE) then
intro_wait=1 intro_wait=1
elseif btnp(KEY_M) then elseif key.press(key.M) then
mute = not mute mute = not mute
end end
intro_wait=intro_wait-1 intro_wait=intro_wait-1
if intro_wait==0 then if intro_wait==0 then
if intro_step==0 then if intro_step==0 then
cls(16) surf.cls(16)
rect(15,3,113,53,2) draw.rect(15,3,99,51,2)
camera(-16,-4) view.origin(16,4)
mapa_draw(10) mapa_draw(10)
rectfill(73,24,79,39,16) draw.rectf(73,24,7,16,16)
blit(0,0,16,16,44,24,16,16,true) draw.surf(0,0,16,16,44,24,16,16,true)
camera(0,0) view.origin(0,0)
intro_step=intro_step+1 intro_step=intro_step+1
elseif intro_step==1 then elseif intro_step==1 then
start_scene(scenes.intro_01,58) start_scene(scenes.intro_01,58)
intro_step=intro_step+1 intro_step=intro_step+1
elseif intro_step==2 then elseif intro_step==2 then
cls(16) surf.cls(16)
rect(15,3,113,53,2) draw.rect(15,3,99,51,2)
camera(-16,-4) view.origin(16,4)
mapa_draw(10) mapa_draw(10)
rectfill(73,24,79,39,16) draw.rectf(73,24,7,16,16)
blit(0,0,16,16,44,24,16,16,false) draw.surf(0,0,16,16,44,24,16,16,false)
camera(0,0) view.origin(0,0)
intro_step=intro_step+1 intro_step=intro_step+1
elseif intro_step==3 then elseif intro_step==3 then
start_scene(scenes.intro_02,58) start_scene(scenes.intro_02,58)
intro_step=intro_step+1 intro_step=intro_step+1
elseif intro_step==4 then elseif intro_step==4 then
cls(16) surf.cls(16)
rect(15,3,113,53,2) draw.rect(15,3,99,51,2)
camera(-16,-4) view.origin(16,4)
mapa_draw(10) mapa_draw(10)
rectfill(73,24,79,39,16) draw.rectf(73,24,7,16,16)
blit(0,0,16,16,44,24,16,16,false) draw.surf(0,0,16,16,44,24,16,16,false)
blit(112,88,16,8,76,32,16,8,true) draw.surf(112,88,16,8,76,32,16,8,true)
blit(0,48,16,16,82,24,16,16,true) draw.surf(0,48,16,16,82,24,16,16,true)
camera(0,0) view.origin(0,0)
intro_step=intro_step+1 intro_step=intro_step+1
elseif intro_step==5 then elseif intro_step==5 then
start_scene(scenes.intro_03,58) start_scene(scenes.intro_03,58)
intro_step=intro_step+1 intro_step=intro_step+1
elseif intro_step==6 then elseif intro_step==6 then
cls(16) surf.cls(16)
rect(15,3,113,53,2) draw.rect(15,3,99,51,2)
camera(-16,-4) view.origin(16,4)
mapa_draw(10) mapa_draw(10)
rectfill(73,24,79,39,16) draw.rectf(73,24,7,16,16)
blit(0,0,16,16,44,24,16,16,false) draw.surf(0,0,16,16,44,24,16,16,false)
camera(0,0) view.origin(0,0)
intro_step=intro_step+1 intro_step=intro_step+1
elseif intro_step==7 then elseif intro_step==7 then
start_scene(scenes.intro_04,58) start_scene(scenes.intro_04,58)

View File

@@ -31,78 +31,77 @@ require "game"
--require "audio" --require "audio"
--require "intro" --require "intro"
function _init() function mini.init()
tiles=loadsurf("tiles.gif") tiles=surf.load("tiles.gif")
setsource(tiles) surf.source(tiles)
local pal=loadpal("tiles.gif") local paleta=pal.load("tiles.gif")
setpal(pal) pal.set(paleta)
logo=newsurf(36,5) logo=surf.new(36,5)
back=newsurf(128,96) back=surf.new(128,96)
fade.init() fade.init()
audio_text_abad = loadsound(audio_text_abad) audio_text_abad = sound.load(audio_text_abad)
audio_text_premiere = loadsound(audio_text_premiere) audio_text_premiere = sound.load(audio_text_premiere)
audio_text_elalien = loadsound(audio_text_elalien) audio_text_elalien = sound.load(audio_text_elalien)
audio_text_batman = loadsound(audio_text_batman) audio_text_batman = sound.load(audio_text_batman)
audio_abad_jump = loadsound(audio_abad_jump) audio_abad_jump = sound.load(audio_abad_jump)
audio_abad_fall = loadsound(audio_abad_fall) audio_abad_fall = sound.load(audio_abad_fall)
audio_abad_hit = loadsound(audio_abad_hit) audio_abad_hit = sound.load(audio_abad_hit)
audio_abad_shot = loadsound(audio_abad_shot) audio_abad_shot = sound.load(audio_abad_shot)
audio_abad_step[1] = loadsound(audio_abad_step[1]) audio_abad_step[1] = sound.load(audio_abad_step[1])
audio_abad_step[2] = loadsound(audio_abad_step[2]) audio_abad_step[2] = sound.load(audio_abad_step[2])
audio_abad_step[3] = loadsound(audio_abad_step[3]) audio_abad_step[3] = sound.load(audio_abad_step[3])
audio_abad_step[4] = audio_abad_step[2] audio_abad_step[4] = audio_abad_step[2]
audio_switch = loadsound(audio_switch) audio_switch = sound.load(audio_switch)
audio_hit = loadsound(audio_hit) audio_hit = sound.load(audio_hit)
audio_low = loadsound(audio_low) audio_low = sound.load(audio_low)
keyUp = tonumber(getconf("keyup")) or KEY_UP keyUp = tonumber(config.key("keyup")) or key.UP
keyDown = tonumber(getconf("keydown")) or KEY_DOWN keyDown = tonumber(config.key("keydown")) or key.DOWN
keyLeft = tonumber(getconf("keyleft")) or KEY_LEFT keyLeft = tonumber(config.key("keyleft")) or key.LEFT
keyRight = tonumber(getconf("keyright")) or KEY_RIGHT keyRight = tonumber(config.key("keyright")) or key.RIGHT
keyJump = tonumber(getconf("keyjump")) or KEY_UP keyJump = tonumber(config.key("keyjump")) or key.UP
keyShoot = tonumber(getconf("keyshoot")) or KEY_SPACE keyShoot = tonumber(config.key("keyshoot")) or key.SPACE
btnUp = tonumber(getconf("btnup")) or BTN_UP btnUp = tonumber(config.key("btnup")) or pad.UP
btnDown = tonumber(getconf("btndown")) or BTN_DOWN btnDown = tonumber(config.key("btndown")) or pad.DOWN
btnLeft = tonumber(getconf("btnleft")) or BTN_LEFT btnLeft = tonumber(config.key("btnleft")) or pad.LEFT
btnRight = tonumber(getconf("btnright")) or BTN_RIGHT btnRight = tonumber(config.key("btnright")) or pad.RIGHT
btnJump = tonumber(getconf("btnjump")) or BTN_B btnJump = tonumber(config.key("btnjump")) or pad.B
btnShoot = tonumber(getconf("btnshoot")) or BTN_A btnShoot = tonumber(config.key("btnshoot")) or pad.A
btnCycle1 = tonumber(getconf("btnCycle1")) or BTN_RIGHTSHOULDER btnCycle1 = tonumber(config.key("btnCycle1")) or pad.RIGHTSHOULDER
btnCycle2 = tonumber(getconf("btnCycle2")) or BTN_LEFTSHOULDER btnCycle2 = tonumber(config.key("btnCycle2")) or pad.LEFTSHOULDER
btnPause = tonumber(getconf("btnPause")) or BTN_START btnPause = tonumber(config.key("btnPause")) or pad.START
--game_init() --game_init()
intro_init() intro_init()
--final_init() --final_init()
end end
function _update() function mini.update()
if btnp(KEY_F1) then if key.press(key.F1) then
zoom(zoom()-1) win.zoom(win.zoom()-1)
elseif btnp(KEY_F2) then elseif key.press(key.F2) then
zoom(zoom()+1) win.zoom(win.zoom()+1)
elseif btnp(KEY_F3) then elseif key.press(key.F3) then
local fs = fullscreen() local fs = win.fullscreen()
fullscreen(not fs) win.fullscreen(not fs)
cursor(fs) win.cursor(fs)
end end
if (game_update) then game_update() end if (game_update) then game_update() end
end end
function text(str,x,y,col) function text(str,x,y,col)
color(16) draw.text(str,x-1,y-1,16)
prnt(str,x-1,y-1) draw.text(str,x,y-1,16)
prnt(str,x,y-1) draw.text(str,x+1,y-1,16)
prnt(str,x+1,y-1) draw.text(str,x-1,y,16)
prnt(str,x-1,y) draw.text(str,x+1,y,16)
prnt(str,x+1,y) draw.text(str,x-1,y+1,16)
prnt(str,x-1,y+1) draw.text(str,x,y+1,16)
prnt(str,x,y+1) draw.text(str,x+1,y+1,16)
prnt(str,x+1,y+1)
prnt(str,x,y,col) draw.text(str,x,y,col)
end end

View File

@@ -48,7 +48,7 @@ function mapa_new()
end end
function mapa_save() function mapa_save()
file = io.open("data/map.lua", "w") local file = io.open("data/map.lua", "w")
io.output(file) io.output(file)
io.write("mapa={\n") io.write("mapa={\n")
for i=1,80 do for i=1,80 do
@@ -93,7 +93,7 @@ function mapa_draw(hab)
for tx=0,11 do for tx=0,11 do
local tile=mapa[1+hab][1+tx+ty*12] local tile=mapa[1+hab][1+tx+ty*12]
if tile~=256 and (tile<126 or mapa.step>4) then if tile~=256 and (tile<126 or mapa.step>4) then
blit((tile&15)*8,64+(tile>>4)*8,8,8,tx*8,ty*8) draw.surf((tile&15)*8,64+(tile>>4)*8,8,8,tx*8,ty*8)
end end
end end
end end
@@ -148,8 +148,8 @@ end
pix={14,10,7,1,0,0,0,0,4,4,4,4,0,0,0,8,14,14,14,14,14,14,0,0,10,10,10,10,10,10,10,10,7,7,7,7,7,7,2,2,1,1,1,1,1,1,12,12,1,1,1,9,9,9,10,10,10,0,0,0,0,0,0,0} pix={14,10,7,1,0,0,0,0,4,4,4,4,0,0,0,8,14,14,14,14,14,14,0,0,10,10,10,10,10,10,10,10,7,7,7,7,7,7,2,2,1,1,1,1,1,1,12,12,1,1,1,9,9,9,10,10,10,0,0,0,0,0,0,0}
function mapa_create_minimap() function mapa_create_minimap()
minimap = newsurf(128,96) minimap = surf.new(128,96)
setdest(minimap) surf.target(minimap)
for h=0,79 do for h=0,79 do
for y=0,5 do for y=0,5 do
for x=0,11 do for x=0,11 do
@@ -158,7 +158,7 @@ function mapa_create_minimap()
print(x..","..y.."="..tile) print(x..","..y.."="..tile)
end end
if tile<64 then if tile<64 then
pset(x+(h%10)*12,y+math.floor(h/10)*6,pix[1+tile]) surf.pixel(x+(h%10)*12,y+math.floor(h/10)*6,pix[1+tile])
end end
end end
end end
@@ -168,8 +168,8 @@ end
function mapa_draw_minimap() function mapa_draw_minimap()
--print("HOLA") --print("HOLA")
setsource(minimap) surf.source(minimap)
setdest(0) surf.target(0)
cls(16) surf.cls(16)
blit(0,0,128,96,0,0) draw.surf(0,0,128,96,0,0)
end end

View File

@@ -2,7 +2,7 @@ peu={hab=5,x=48,y=24,bb={x=0,y=0,w=8,h=8}}
function peu.init() function peu.init()
local habs={{18,8},{16,2},{16,7},{15,5},{27,1},{27,10},{29,2},{38,8},{69,2},{79,3}} local habs={{18,8},{16,2},{16,7},{15,5},{27,1},{27,10},{29,2},{38,8},{69,2},{79,3}}
local r=1+rnd(#habs) local r=1+math.random(0,#habs-1)
peu.hab=habs[r][1] peu.hab=habs[r][1]
peu.x=habs[r][2]*8 peu.x=habs[r][2]*8
peu.update=peu.update peu.update=peu.update
@@ -10,7 +10,7 @@ function peu.init()
end end
function peu.draw() function peu.draw()
blit(112,32,16,16,peu.x,peu.y,16,16) draw.surf(112,32,16,16,peu.x,peu.y,16,16)
end end
function peu.update() function peu.update()

View File

@@ -10,11 +10,11 @@ function premiere.init()
premiere.scene_intro=false premiere.scene_intro=false
premiere.scene_object=false premiere.scene_object=false
local habs={75,44,20,0} local habs={75,44,20,0}
premiere.hab=habs[1+rnd(4)] premiere.hab=habs[1+math.random(0,3)]
end end
function premiere.draw() function premiere.draw()
blit((premiere.frame&7)*16,(premiere.frame>>3)*16,16,16,premiere.x,premiere.y,16,16,premiere.flip) draw.surf((premiere.frame&7)*16,(premiere.frame>>3)*16,16,16,premiere.x,premiere.y,16,16,premiere.flip)
end end
function premiere.hit() function premiere.hit()

View File

@@ -132,7 +132,7 @@ function start_scene(scene,offset)
--bkg=newsurf(128,96) --bkg=newsurf(128,96)
--setdest(bkg) --setdest(bkg)
--setsource(0) --setsource(0)
--blit(0,0,128,96,0,0) --draw.surf(0,0,128,96,0,0)
--setsource(tiles) --setsource(tiles)
--setdest(0) --setdest(0)
scenes.current_scene=scene scenes.current_scene=scene
@@ -165,34 +165,34 @@ end
function draw_scene() function draw_scene()
local txt_x = not scenes.current_scene[scenes.dnum].flip and 38 or 8 local txt_x = not scenes.current_scene[scenes.dnum].flip and 38 or 8
camera(0,-scenes.offset) view.origin(0,scenes.offset)
if scenes.step==0 then if scenes.step==0 then
rectfill(0,16,128,17,12) draw.rectf(0,16,129,2,12)
line(0,15,128,15,16) draw.line(0,15,128,15,16)
line(0,18,128,18,16) draw.line(0,18,128,18,16)
elseif scenes.step==1 then elseif scenes.step==1 then
rectfill(0,8,128,26,12) draw.rectf(0,8,129,19,12)
line(0,7,128,7,16) draw.line(0,7,128,7,16)
line(0,27,128,27,16) draw.line(0,27,128,27,16)
elseif scenes.step==2 then elseif scenes.step==2 then
rectfill(0,0,128,34,12) draw.rectf(0,0,129,35,12)
line(0,0,128,0,16) draw.line(0,0,128,0,16)
line(0,34,128,34,16) draw.line(0,34,128,34,16)
elseif scenes.step==3 then elseif scenes.step==3 then
if not scenes.current_scene[scenes.dnum].flip then if not scenes.current_scene[scenes.dnum].flip then
rectfill(8,12,31,23,16) draw.rectf(8,12,24,12,16)
blit(scenes.current_scene[scenes.dnum].x,scenes.current_scene[scenes.dnum].y,10,10,9,13,20,10) draw.surf(scenes.current_scene[scenes.dnum].x,scenes.current_scene[scenes.dnum].y,10,10,9,13,20,10)
else else
rectfill(97,12,120,23,16) draw.rectf(97,12,24,12,16)
blit(scenes.current_scene[scenes.dnum].x,scenes.current_scene[scenes.dnum].y,10,10,98,13,20,10,true) draw.surf(scenes.current_scene[scenes.dnum].x,scenes.current_scene[scenes.dnum].y,10,10,98,13,20,10,true)
end end
elseif scenes.step==4 then elseif scenes.step==4 then
if not scenes.current_scene[scenes.dnum].flip then if not scenes.current_scene[scenes.dnum].flip then
rectfill(8,7,31,28,16) draw.rectf(8,7,24,22,16)
blit(scenes.current_scene[scenes.dnum].x,scenes.current_scene[scenes.dnum].y,10,10,9,8,20,20) draw.surf(scenes.current_scene[scenes.dnum].x,scenes.current_scene[scenes.dnum].y,10,10,9,8,20,20)
else else
rectfill(97,7,120,28,16) draw.rectf(97,7,24,22,16)
blit(scenes.current_scene[scenes.dnum].x,scenes.current_scene[scenes.dnum].y,10,10,98,8,20,20,true) draw.surf(scenes.current_scene[scenes.dnum].x,scenes.current_scene[scenes.dnum].y,10,10,98,8,20,20,true)
end end
elseif scenes.step==5 then elseif scenes.step==5 then
text(string.sub(scenes.current_scene[scenes.dnum].text[1],1,scenes.char),txt_x,7,2) text(string.sub(scenes.current_scene[scenes.dnum].text[1],1,scenes.char),txt_x,7,2)
@@ -222,22 +222,22 @@ function draw_scene()
scenes.char=1 scenes.char=1
end end
elseif scenes.step==8 then elseif scenes.step==8 then
rectfill(0,0,128,34,12) draw.rectf(0,0,129,35,12)
line(0,0,128,0,16) draw.line(0,0,128,0,16)
line(0,34,128,34,16) draw.line(0,34,128,34,16)
if not scenes.current_scene[scenes.dnum].flip then if not scenes.current_scene[scenes.dnum].flip then
rectfill(8,7,31,28,16) draw.rectf(8,7,24,22,16)
blit(scenes.current_scene[scenes.dnum].x,scenes.current_scene[scenes.dnum].y,10,10,9,8,20,20) draw.surf(scenes.current_scene[scenes.dnum].x,scenes.current_scene[scenes.dnum].y,10,10,9,8,20,20)
else else
rectfill(97,7,120,28,16) draw.rectf(97,7,24,22,16)
blit(scenes.current_scene[scenes.dnum].x,scenes.current_scene[scenes.dnum].y,10,10,98,8,20,20,true) draw.surf(scenes.current_scene[scenes.dnum].x,scenes.current_scene[scenes.dnum].y,10,10,98,8,20,20,true)
end end
text(scenes.current_scene[scenes.dnum].text[1],txt_x,7,2) 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[2],txt_x,15,2)
text(scenes.current_scene[scenes.dnum].text[3],txt_x,23,2) text(scenes.current_scene[scenes.dnum].text[3],txt_x,23,2)
end end
if scenes.step<=8 then scenes.step=scenes.step+1 end if scenes.step<=8 then scenes.step=scenes.step+1 end
camera(0,0) view.origin(0,0)
end end
function update_scene() function update_scene()
@@ -252,7 +252,7 @@ function update_scene()
scenes.die=scenes.die-1 scenes.die=scenes.die-1
if scenes.die==0 then if scenes.die==0 then
if scenes.dnum==#scenes.current_scene then if scenes.dnum==#scenes.current_scene then
stopmusic() music.stop()
if batman.endgame then if batman.endgame then
final_init() final_init()
fade.fadeoutin() fade.fadeoutin()
@@ -266,30 +266,30 @@ function update_scene()
end end
end end
else else
if math.floor(time()*2)%2==0 then if math.floor(sys.time()*2)%2==0 then
blit(104,88,7,5,118,56) draw.surf(104,88,7,5,118,56)
else else
rectfill(118,56,125,61,12) draw.rectf(118,56,8,6,12)
end end
end end
end end
end end
if (btnp(KEY_ESCAPE) or padp(btnPause)) and (scenes.current_scene~=scenes.final) then if (key.press(key.ESCAPE) or pad.press(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
pause() pause()
end end
elseif btnp(KEY_M) then elseif key.press(key.M) then
mute = not mute mute = not mute
end end
if scenes.step>8 then if scenes.step>8 then
if btnp(keyShoot) or btnp(keyDown) or btnp(keyUp) or btnp(keyLeft) or btnp(keyRight) or btnp(KEY_RETURN) or if key.press(keyShoot) or key.press(keyDown) or key.press(keyUp) or key.press(keyLeft) or key.press(keyRight) or key.press(key.RETURN) or
padp(btnShoot) or padp(btnDown) or padp(btnUp) or padp(btnLeft) or padp(btnRight) then pad.press(btnShoot) or pad.press(btnDown) or pad.press(btnUp) or pad.press(btnLeft) or pad.press(btnRight) then
if scenes.dnum==#scenes.current_scene then if scenes.dnum==#scenes.current_scene then
stopmusic() music.stop()
if batman.endgame then if batman.endgame then
final_init() final_init()
fade.fadeoutin() fade.fadeoutin()
@@ -301,7 +301,7 @@ function update_scene()
scenes.step=2 scenes.step=2
end end
end end
elseif btnp(keyShoot) or padp(btnShoot) then elseif key.press(keyShoot) or pad.press(btnShoot) then
scenes.step=8 scenes.step=8
end end
end end

View File

@@ -1,43 +1,43 @@
score={} score={}
function score.create() function score.create()
score.surf=newsurf(32,96) score.surf=surf.new(32,96)
setdest(score.surf) surf.target(score.surf)
cls(16) surf.cls(16)
blit(0,0,16,9,5,9,16,9,true) draw.surf(0,0,16,9,5,9,16,9,true)
blit(32,64,8,8,0,0) blit(48,72,8,8,8,0) blit(48,72,8,8,16,0) blit(40,64,8,8,24,0) draw.surf(32,64,8,8,0,0) draw.surf(48,72,8,8,8,0) draw.surf(48,72,8,8,16,0) draw.surf(40,64,8,8,24,0)
blit(48,64,8,8,0,8) blit(56,64,8,8,24,8) blit(48,64,8,8,0,16) blit(56,64,8,8,24,16) draw.surf(48,64,8,8,0,8) draw.surf(56,64,8,8,24,8) draw.surf(48,64,8,8,0,16) draw.surf(56,64,8,8,24,16)
blit(32,64,8,8,0,24) blit(48,72,8,8,8,24) blit(48,72,8,8,16,24) blit(40,64,8,8,24,24) draw.surf(32,64,8,8,0,24) draw.surf(48,72,8,8,8,24) draw.surf(48,72,8,8,16,24) draw.surf(40,64,8,8,24,24)
blit(48,64,8,8,0,32) blit(56,64,8,8,24,32) draw.surf(48,64,8,8,0,32) draw.surf(56,64,8,8,24,32)
blit(32,64,8,8,0,40) blit(48,72,8,8,8,40) blit(48,72,8,8,16,40) blit(40,64,8,8,24,40) draw.surf(32,64,8,8,0,40) draw.surf(48,72,8,8,8,40) draw.surf(48,72,8,8,16,40) draw.surf(40,64,8,8,24,40)
blit(48,64,8,8,0,48) blit(56,64,8,8,24,48) blit(48,64,8,8,0,56) blit(56,64,8,8,24,56) draw.surf(48,64,8,8,0,48) draw.surf(56,64,8,8,24,48) draw.surf(48,64,8,8,0,56) draw.surf(56,64,8,8,24,56)
blit(48,64,8,8,0,64) blit(56,64,8,8,24,64) --blit(48,64,8,8,0,72) blit(56,64,8,8,24,72) draw.surf(48,64,8,8,0,64) draw.surf(56,64,8,8,24,64) --draw.surf(48,64,8,8,0,72) draw.surf(56,64,8,8,24,72)
blit(32,64,8,8,0,72) blit(48,72,8,8,8,72) blit(48,72,8,8,16,72) blit(40,64,8,8,24,72) draw.surf(32,64,8,8,0,72) draw.surf(48,72,8,8,8,72) draw.surf(48,72,8,8,16,72) draw.surf(40,64,8,8,24,72)
blit(48,64,8,8,0,80) blit(56,64,8,8,24,80) blit(48,64,8,8,0,88) blit(56,64,8,8,24,88) draw.surf(48,64,8,8,0,80) draw.surf(56,64,8,8,24,80) draw.surf(48,64,8,8,0,88) draw.surf(56,64,8,8,24,88)
prnt("jail",6,77,2) draw.text("jail",6,77,2)
prnt("games",8, 82,2) draw.text("games",8, 82,2)
prnt("2023",9,89,1) draw.text("2023",9,89,1)
rectfill(06,30,07,37,03) draw.rectf(06,30,2,8,03)
rectfill(09,30,10,37,08) draw.rectf(09,30,2,8,08)
rectfill(12,30,13,37,08) draw.rectf(12,30,2,8,08)
rectfill(15,30,16,37,10) draw.rectf(15,30,2,8,10)
rectfill(18,30,19,37,10) draw.rectf(18,30,2,8,10)
rectfill(21,30,22,37,10) draw.rectf(21,30,2,8,10)
rectfill(24,30,25,37,10) draw.rectf(24,30,2,8,10)
setdest(0) surf.target(0)
end end
function score.draw() function score.draw()
setsource(score.surf) surf.source(score.surf)
blit(0,0,32,96,96,0) draw.surf(0,0,32,96,96,0)
setsource(tiles) surf.source(tiles)
if abad.objects.gorro~=nil then blit(96,32,16,16,99,44) end if abad.objects.gorro~=nil then draw.surf(96,32,16,16,99,44) end
if abad.objects.peu~=nil then blit(112,32,16,16,109,44) end if abad.objects.peu~=nil then draw.surf(112,32,16,16,109,44) end
if abad.objects.gps~=nil then blit(112,48,16,16,100,55) end if abad.objects.gps~=nil then draw.surf(112,48,16,16,100,55) end
if abad.objects.clau_premiere~=nil then blit(112,8,8,8,104,48) end if abad.objects.clau_premiere~=nil then draw.surf(112,8,8,8,104,48) end
if abad.objects.clau_elalien~=nil then blit(120,8,8,8,112,48) end if abad.objects.clau_elalien~=nil then draw.surf(120,8,8,8,112,48) end
if abad.objects.bol~=nil then blit(112,88,16,8,104,46) end if abad.objects.bol~=nil then draw.surf(112,88,16,8,104,46) end
end end

View File

@@ -72,7 +72,7 @@ end
function triggers:teleport_a() function triggers:teleport_a()
abad.teleport=true abad.teleport=true
playsnd(audio_hit) playsnd(audio_hit)
cls(14) surf.cls(14)
imp.reset() imp.reset()
abad.hab=67 abad.hab=67
abad.x=24 abad.x=24
@@ -81,7 +81,7 @@ end
function triggers:teleport_b() function triggers:teleport_b()
if abad.teleport then if abad.teleport then
playsnd(audio_hit) playsnd(audio_hit)
cls(14) surf.cls(14)
imp.reset() imp.reset()
abad.hab=14 abad.hab=14
abad.x=16 abad.x=16
@@ -91,7 +91,7 @@ end
function triggers:teleport_c() function triggers:teleport_c()
abad.teleport2=true abad.teleport2=true
playsnd(audio_hit) playsnd(audio_hit)
cls(14) surf.cls(14)
imp.reset() imp.reset()
abad.hab=61 abad.hab=61
abad.x=24 abad.x=24
@@ -100,7 +100,7 @@ end
function triggers:teleport_d() function triggers:teleport_d()
if abad.teleport2 then if abad.teleport2 then
playsnd(audio_hit) playsnd(audio_hit)
cls(14) surf.cls(14)
imp.reset() imp.reset()
abad.hab=29 abad.hab=29
abad.x=24 abad.x=24

View File

@@ -5,7 +5,7 @@ function zombie.new(_hab,_x,_y,_flip)
end end
function zombie:draw() function zombie:draw()
if self.frame>0 then blit((self.frame&7)*16,(self.frame>>3)*16,16,16,self.x,self.y,16,16,self.flip) end if self.frame>0 then draw.surf((self.frame&7)*16,(self.frame>>3)*16,16,16,self.x,self.y,16,16,self.flip) end
end end
function zombie:update_normal() function zombie:update_normal()