Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9afc51f9a0 | |||
| 75a1fb95d9 | |||
| 17654b2c82 | |||
| a3ca7bec86 | |||
| 5c3e01d3e4 | |||
| 9a4f41541f | |||
| 3898289f57 | |||
| 33af343c80 | |||
| dba989ca24 | |||
| f7a5cd8ca4 | |||
| 61a666cbb3 | |||
| 77c1da8649 | |||
| 993ddfa88e | |||
| c126ce5f4a | |||
| db9ce7898b | |||
| 0b2f30bac8 | |||
| e11d869dc2 |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1 +1,6 @@
|
||||
.DS_STORE
|
||||
release/*
|
||||
*.exe
|
||||
*.dll
|
||||
mini
|
||||
mini_debug
|
||||
|
||||
@@ -23,11 +23,11 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0.8</string>
|
||||
<string>1.1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0.8</string>
|
||||
<string>1.1.0</string>
|
||||
<key>CSResourcesFileMapped</key>
|
||||
<true/>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
|
||||
BIN
bin/cacaus.ico
Normal file
BIN
bin/cacaus.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 100 KiB |
1
bin/icon.rc
Normal file
1
bin/icon.rc
Normal file
@@ -0,0 +1 @@
|
||||
id ICON "cacaus.ico"
|
||||
BIN
bin/icon.res
Normal file
BIN
bin/icon.res
Normal file
Binary file not shown.
@@ -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}}
|
||||
|
||||
function abad_nop()
|
||||
@@ -16,8 +18,8 @@ function abad:draw()
|
||||
if abad.update==abad_state_stairs then
|
||||
flip=(((abad.x>>1)+(abad.y>>1))%2)==0
|
||||
end
|
||||
if (abad.respawning==0) or (flr(abad.respawning/15)%2==0) then
|
||||
sspr(abad.frame*16,0,16,16,abad.x,abad.y,16,16,flip)
|
||||
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)
|
||||
end
|
||||
|
||||
if abad.respawning > 0 then
|
||||
@@ -81,13 +83,13 @@ function abad_state_normal()
|
||||
end
|
||||
abad_make_safe()
|
||||
|
||||
if btn(KEY_RIGHT) then
|
||||
if btn(keyRight) or pad(btnRight) then
|
||||
abad.update=abad_state_walking
|
||||
abad.flip=false
|
||||
elseif btn(KEY_LEFT) then
|
||||
elseif btn(keyLeft) or pad(btnLeft) then
|
||||
abad.update=abad_state_walking
|
||||
abad.flip=true
|
||||
elseif btn(KEY_UP) then
|
||||
elseif btn(keyJump) or pad(btnJump) then
|
||||
abad.update=abad_state_jumping
|
||||
abad.step=0
|
||||
abad.jumpfwd=false
|
||||
@@ -96,11 +98,11 @@ function abad_state_normal()
|
||||
abad.jump=nil
|
||||
end
|
||||
playsnd(audio_abad_jump)
|
||||
elseif btn(KEY_DOWN) then
|
||||
elseif btn(keyDown) or pad(btnDown) then
|
||||
abad.update=abad_state_crouch
|
||||
elseif btn(KEY_Z) then
|
||||
abad.respawning=240
|
||||
elseif btnp(KEY_SPACE) and cacau.hab==-1 then
|
||||
--elseif btn(KEY_Z) then
|
||||
-- abad.respawning=240
|
||||
elseif btn(keyShoot) or pad(btnShoot) and cacau.hab==-1 then
|
||||
playsnd(audio_abad_shot)
|
||||
abad.update=abad_state_fire
|
||||
abad.wait=0
|
||||
@@ -116,7 +118,7 @@ function abad_state_crouch()
|
||||
abad.step=0
|
||||
abad.jumpfwd=false
|
||||
|
||||
if not btn(KEY_DOWN) then
|
||||
if not (btn(keyDown) or pad(btnDown)) then
|
||||
abad.update=abad_state_normal
|
||||
abad.bb.y=0
|
||||
abad.bb.h=16
|
||||
@@ -185,7 +187,7 @@ function abad_state_walking()
|
||||
|
||||
abad_make_safe()
|
||||
|
||||
if btn(KEY_UP) then
|
||||
if btn(keyJump) or pad(btnJump) then
|
||||
abad.update=abad_state_jumping
|
||||
abad.step=0
|
||||
abad.jumpfwd=true
|
||||
@@ -195,18 +197,18 @@ function abad_state_walking()
|
||||
end
|
||||
playsnd(audio_abad_jump)
|
||||
return
|
||||
elseif btn(KEY_DOWN) then
|
||||
elseif btn(keyDown) or pad(btnDown) then
|
||||
abad.update=abad_state_crouch
|
||||
elseif btn(KEY_SPACE) and cacau.hab==-1 then
|
||||
elseif btn(keyShoot) or pad(btnShoot) and cacau.hab==-1 then
|
||||
playsnd(audio_abad_shot)
|
||||
abad.update=abad_state_fire
|
||||
abad.wait=0
|
||||
cacau.init(abad.hab,abad.x+8,abad.y+8,abad.flip)
|
||||
end
|
||||
|
||||
if btn(KEY_RIGHT) then
|
||||
if btn(keyRight) or pad(btnRight) then
|
||||
abad.flip=false
|
||||
elseif btn(KEY_LEFT) then
|
||||
elseif btn(keyLeft) or pad(btnLeft) then
|
||||
abad.flip=true
|
||||
elseif abad.wait==0 then
|
||||
abad.update=abad_state_normal
|
||||
@@ -224,8 +226,8 @@ function abad_state_jumping()
|
||||
|
||||
if abad.jumpfwd then abad_advance() end
|
||||
|
||||
--local xx=flr((abad.x+4)/8)
|
||||
--local yy=flr(abad.y/8)
|
||||
--local xx=math.floor((abad.x+4)/8)
|
||||
--local yy=math.floor(abad.y/8)
|
||||
--rect(xx*8,yy*8, (xx+2)*8,(yy+1)*8)
|
||||
if abad.step<6 then
|
||||
if abad.y>0 then
|
||||
@@ -234,14 +236,14 @@ function abad_state_jumping()
|
||||
|
||||
if check_tile(abad.hab,abad.x+4,abad.y-2)==tiletype.switch then
|
||||
-- Executar el switch
|
||||
local xx=min(11,max(0,flr((abad.x+4)/8)))
|
||||
local yy=min(5,max(0,flr((abad.y-2)/8)))
|
||||
local xx=math.min(11,math.max(0,math.floor((abad.x+4)/8)))
|
||||
local yy=math.min(5,math.max(0,math.floor((abad.y-2)/8)))
|
||||
switches.start(abad.hab,1+xx+yy*12)
|
||||
--cls(4)
|
||||
elseif (abad.x+4)&7~=0 and check_tile(abad.hab,abad.x+12,abad.y-2)==tiletype.switch then
|
||||
-- Executar el switch
|
||||
local xx=min(11,max(0,flr((abad.x+12)/8)))
|
||||
local yy=min(5,max(0,flr((abad.y-2)/8)))
|
||||
local xx=math.min(11,math.max(0,math.floor((abad.x+12)/8)))
|
||||
local yy=math.min(5,math.max(0,math.floor((abad.y-2)/8)))
|
||||
switches.start(abad.hab,1+xx+yy*12)
|
||||
--cls(4)
|
||||
else
|
||||
@@ -272,8 +274,8 @@ function abad_state_falling()
|
||||
|
||||
if abad.jumpfwd then abad_advance() end
|
||||
|
||||
local xx=flr((abad.x+4)/8)
|
||||
local yy=flr((abad.y+16)/8)
|
||||
local xx=math.floor((abad.x+4)/8)
|
||||
local yy=math.floor((abad.y+16)/8)
|
||||
|
||||
if abad.y<32 then
|
||||
if (abad.y+16)&7==0 and (check_tile(abad.hab,abad.x+4,abad.y+16)>=tiletype.half or ((abad.x+4)&7~=0 and check_tile(abad.hab,abad.x+12,abad.y+16)>=tiletype.half)) then
|
||||
@@ -297,15 +299,15 @@ function abad_state_stairs()
|
||||
if abad.wait==6 then
|
||||
abad.wait=0
|
||||
|
||||
if btn(KEY_RIGHT) then
|
||||
if btn(keyRight) or pad(btnRight) then
|
||||
abad.flip=false
|
||||
abad_advance()
|
||||
playsnd(audio_low)
|
||||
elseif btn(KEY_LEFT) then
|
||||
elseif btn(keyLeft) or pad(btnLeft) then
|
||||
abad.flip=true
|
||||
abad_advance()
|
||||
playsnd(audio_low)
|
||||
elseif btn(KEY_UP) then
|
||||
elseif btn(keyUp) or pad(btnUp) 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
|
||||
abad.y=abad.y-2
|
||||
@@ -316,7 +318,7 @@ function abad_state_stairs()
|
||||
imp.reset()
|
||||
abad.y=32
|
||||
end
|
||||
elseif btn(KEY_DOWN) then
|
||||
elseif btn(keyDown) or pad(btnDown) 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
|
||||
abad.y=abad.y+2
|
||||
|
||||
@@ -44,7 +44,7 @@ end
|
||||
|
||||
function bambolla.draw_normal()
|
||||
if bambolla.enabled then
|
||||
sspr(112,16,16,16,bambolla.x,bambolla.y,16,16)
|
||||
blit(112,16,16,16,bambolla.x,bambolla.y,16,16)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -77,7 +77,7 @@ function bambolla.update_normal()
|
||||
bambolla.reset()
|
||||
end
|
||||
end
|
||||
bambolla.y=28-abs(sin(bambolla.x*0.1))*24
|
||||
bambolla.y=28-math.abs(math.sin(bambolla.x*0.1))*24
|
||||
if bambolla.hab==abad.hab and bambolla.y>25.2 then
|
||||
playsnd(audio_low)
|
||||
end
|
||||
|
||||
@@ -6,6 +6,8 @@ function batman.init()
|
||||
batman.draw=batman.draw
|
||||
local habs={5,9,46,36,18}
|
||||
batman.hab=habs[1+rnd(#habs)]
|
||||
batman.x=24
|
||||
batman.y=24
|
||||
end
|
||||
|
||||
function batman.draw()
|
||||
@@ -13,7 +15,7 @@ function batman.draw()
|
||||
if batman.update==batman.update_stairs then
|
||||
flip=(((batman.x>>1)+(batman.y>>1))%2)==0
|
||||
end
|
||||
sspr((batman.frame&7)*16,(batman.frame>>3)*16,16,16,batman.x,batman.y,16,16,flip)
|
||||
blit((batman.frame&7)*16,(batman.frame>>3)*16,16,16,batman.x,batman.y,16,16,flip)
|
||||
end
|
||||
|
||||
function batman.hit()
|
||||
@@ -213,12 +215,6 @@ function batman.update_stairs()
|
||||
if batman.wait>=6 then
|
||||
batman.wait=0
|
||||
|
||||
--if btn(KEY_RIGHT) then
|
||||
-- batman.flip=false
|
||||
-- batman_advance()
|
||||
--elseif btn(KEY_LEFT) then
|
||||
-- batman.flip=true
|
||||
-- batman_advance()
|
||||
if batman.goup then
|
||||
if batman.y>0 then
|
||||
if check_tile(batman.hab,batman.x+4,batman.y+8)==tiletype.stair or (batman.x+4)&7~=0 and check_tile(batman.hab,batman.x+12,batman.y+8)==tiletype.stair then
|
||||
|
||||
@@ -6,7 +6,7 @@ function bol.init()
|
||||
end
|
||||
|
||||
function bol.draw()
|
||||
sspr(112,88,16,8,bol.x,bol.y,16,8)
|
||||
blit(112,88,16,8,bol.x,bol.y,16,8)
|
||||
end
|
||||
|
||||
function bol.update()
|
||||
|
||||
@@ -5,7 +5,7 @@ function caco.new(_hab,_x,_y,_flip)
|
||||
end
|
||||
|
||||
function caco:draw()
|
||||
if self.frame>0 then sspr((self.frame&7)*16,(self.frame>>3)*16,16,16,self.x,self.y,16,16,self.flip) end
|
||||
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
|
||||
end
|
||||
|
||||
function caco:update_normal()
|
||||
|
||||
@@ -8,7 +8,7 @@ function dead.start()
|
||||
dead.pos[i]=0
|
||||
dead.vel[i]=(200+rnd(400))/400
|
||||
end
|
||||
_update=dead.update
|
||||
game_update=dead.update
|
||||
end
|
||||
|
||||
function dead.update()
|
||||
@@ -39,10 +39,8 @@ function dead.update()
|
||||
end
|
||||
end
|
||||
|
||||
if (dead.count>250 and btnp(KEY_SPACE)) or dead.count>500 then
|
||||
if (dead.count>250 and (btnp(keyShoot) or padp(btnShoot))) or dead.count>500 then
|
||||
game_exit()
|
||||
game_init(true)
|
||||
--_init()
|
||||
--_update=update_game
|
||||
end
|
||||
end
|
||||
@@ -19,7 +19,7 @@ function elalien.draw()
|
||||
if elalien.update==elalien.update_stairs then
|
||||
flip=(((elalien.x>>1)+(elalien.y>>1))%2)==0
|
||||
end
|
||||
sspr((elalien.frame&7)*16,(elalien.frame>>3)*16,16,16,elalien.x,elalien.y,16,16,flip)
|
||||
blit((elalien.frame&7)*16,(elalien.frame>>3)*16,16,16,elalien.x,elalien.y,16,16,flip)
|
||||
end
|
||||
|
||||
function elalien.hit()
|
||||
@@ -223,12 +223,6 @@ function elalien.update_stairs()
|
||||
if elalien.wait>=6 then
|
||||
elalien.wait=0
|
||||
|
||||
--if btn(KEY_RIGHT) then
|
||||
-- elalien.flip=false
|
||||
-- elalien_advance()
|
||||
--elseif btn(KEY_LEFT) then
|
||||
-- elalien.flip=true
|
||||
-- elalien_advance()
|
||||
if elalien.goup then
|
||||
if elalien.y>0 then
|
||||
if check_tile(elalien.hab,elalien.x+4,elalien.y+8)==tiletype.stair or (elalien.x+4)&7~=0 and check_tile(elalien.hab,elalien.x+12,elalien.y+8)==tiletype.stair then
|
||||
|
||||
@@ -8,7 +8,7 @@ fade = {
|
||||
|
||||
init = function()
|
||||
for i=1,15 do
|
||||
local r,g,b=getcolor(i)
|
||||
local r,g,b=palcolor(i)
|
||||
fade.pal[i]={r,g,b}
|
||||
end
|
||||
end,
|
||||
@@ -24,16 +24,16 @@ fade = {
|
||||
|
||||
fadeout = function()
|
||||
--print("fading out")
|
||||
fade.old_update=_update
|
||||
_update=fade.update_fadeout
|
||||
fade.old_update=game_update
|
||||
game_update=fade.update_fadeout
|
||||
fade.wait=0
|
||||
fade.step=0
|
||||
end,
|
||||
|
||||
fadeoutin = function()
|
||||
--print("fading outin")
|
||||
fade.old_update=_update
|
||||
_update=fade.update_fadeout
|
||||
fade.old_update=game_update
|
||||
game_update=fade.update_fadeout
|
||||
fade.wait=0
|
||||
fade.step=0
|
||||
fade.outin=true
|
||||
@@ -48,14 +48,14 @@ fade = {
|
||||
local v=fade.getstep(i,fade.step)
|
||||
--print(v)
|
||||
if v==16 then
|
||||
setcolor(i,0,0,0)
|
||||
palcolor(i,0,0,0)
|
||||
else
|
||||
setcolor(i,fade.pal[v][1],fade.pal[v][2],fade.pal[v][3])
|
||||
palcolor(i,fade.pal[v][1],fade.pal[v][2],fade.pal[v][3])
|
||||
end
|
||||
end
|
||||
fade.step=fade.step+1
|
||||
if fade.step==7 then
|
||||
_update = fade.old_update
|
||||
game_update = fade.old_update
|
||||
if fade.outin then
|
||||
fade.outin=false;
|
||||
fade.fadein()
|
||||
@@ -66,11 +66,11 @@ fade = {
|
||||
|
||||
fadein = function()
|
||||
--print("fading in")
|
||||
fade.old_update=_update
|
||||
_update=fade.update_fadein
|
||||
fade.old_update=game_update
|
||||
game_update=fade.update_fadein
|
||||
fade.wait=0
|
||||
fade.step=6
|
||||
for i=1,15 do setcolor(i,0,0,0) end
|
||||
for i=1,15 do palcolor(i,0,0,0) end
|
||||
end,
|
||||
|
||||
update_fadein=function()
|
||||
@@ -84,14 +84,14 @@ fade = {
|
||||
local v=fade.getstep(i,fade.step)
|
||||
--print(v)
|
||||
if v==16 then
|
||||
setcolor(i,0,0,0)
|
||||
palcolor(i,0,0,0)
|
||||
else
|
||||
setcolor(i,fade.pal[v][1],fade.pal[v][2],fade.pal[v][3])
|
||||
palcolor(i,fade.pal[v][1],fade.pal[v][2],fade.pal[v][3])
|
||||
end
|
||||
end
|
||||
fade.step=fade.step-1
|
||||
if fade.step<0 then
|
||||
_update = fade.old_update
|
||||
game_update = fade.old_update
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -6,11 +6,11 @@ function final_init()
|
||||
current_actor=1
|
||||
|
||||
abad.update = abad_nop
|
||||
_update=update_final
|
||||
game_update=update_final
|
||||
next_actor()
|
||||
playmus(audio_final)
|
||||
local r,g,b=getcolor(15)
|
||||
setcolor(17,r,g,b)
|
||||
local r,g,b=palcolor(15)
|
||||
palcolor(17,r,g,b)
|
||||
--fade.fadein()
|
||||
end
|
||||
|
||||
@@ -81,7 +81,7 @@ function draw_actor()
|
||||
end
|
||||
end
|
||||
if current_actor==7 then
|
||||
actor.y=28-abs(sin(actor.x*0.1))*24
|
||||
actor.y=28-math.abs(math.sin(actor.x*0.1))*24
|
||||
end
|
||||
|
||||
if actor.x>96 or actor.x<-actor.w or (#actor.anim==1 and actor.center_count==0) then
|
||||
@@ -92,7 +92,7 @@ function draw_actor()
|
||||
end
|
||||
end
|
||||
local tpl=128/actor.w
|
||||
sspr((actor.frame%tpl)*actor.w,flr(actor.frame/tpl)*actor.h,actor.w,actor.h,actor.x,actor.y,actor.w,actor.h,actor.flip)
|
||||
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)
|
||||
end
|
||||
|
||||
function next_actor()
|
||||
@@ -128,7 +128,7 @@ function next_actor()
|
||||
init_actor("EL ABAD",true,16,16,{0,1,0,2})
|
||||
elseif current_actor==14 then
|
||||
final_count=0
|
||||
_update=update_final2
|
||||
game_update=update_final2
|
||||
fade.fadeoutin()
|
||||
end
|
||||
final_room=final_rooms[current_actor]
|
||||
@@ -150,7 +150,7 @@ function update_final2()
|
||||
end
|
||||
end
|
||||
final_count=final_count+1
|
||||
if final_count==200 or btnp(KEY_SPACE) or btnp(KEY_RETURN) then
|
||||
if final_count==200 or (btnp(keyShoot) or padp(btnShoot)) or btnp(KEY_RETURN) then
|
||||
game_exit()
|
||||
game_init(true)
|
||||
fade.fadeoutin()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
title=Cacaus
|
||||
config=cacaus
|
||||
width=128
|
||||
height=96
|
||||
zoom=5
|
||||
|
||||
270
data/game.lua
270
data/game.lua
@@ -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}
|
||||
--mode=modes.editing
|
||||
@@ -132,33 +150,21 @@ function game_init(menu)
|
||||
mapa_do_backup()
|
||||
|
||||
if menu then
|
||||
menu_sel=0
|
||||
menu_state=0
|
||||
abad.update = abad_nop
|
||||
_update=update_menu
|
||||
game_update=update_menu
|
||||
menu_count=0
|
||||
menu_change_room=300
|
||||
menu_room=rnd(60)
|
||||
playmus(audio_main_song)
|
||||
else
|
||||
_update=update_game
|
||||
game_update=update_game
|
||||
stopmusic()
|
||||
end
|
||||
--fade.fadein()
|
||||
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)
|
||||
camera(-x,-y)
|
||||
mapa_draw(hab)
|
||||
@@ -185,10 +191,10 @@ function update_dialog()
|
||||
text("(Y)es (N)o",25,40,2)
|
||||
|
||||
if btnp(KEY_N) then
|
||||
_update=update_game
|
||||
game_update=update_game
|
||||
elseif btnp(KEY_Y) then
|
||||
mapa_save()
|
||||
_update=update_game
|
||||
game_update=update_game
|
||||
end
|
||||
end
|
||||
|
||||
@@ -200,14 +206,14 @@ function update_game()
|
||||
draw_hab(abad.hab,0,0,true)
|
||||
text(abad.hab,120,1,2)
|
||||
|
||||
sspr(0,64+scroll*8,128,48,0,48)
|
||||
blit(0,64+scroll*8,128,48,0,48)
|
||||
color(3)
|
||||
local xx=(seltile&15)*8
|
||||
local yy=48+(seltile>>4)*8
|
||||
rect(xx,yy,xx+8,yy+8)
|
||||
text("EDIT",100,1,3)
|
||||
local hx = abad.hab%10
|
||||
local hy = flr(abad.hab/10)
|
||||
local hy = math.floor(abad.hab/10)
|
||||
scroll=0
|
||||
if btnp(KEY_RIGHT) and hx<9 then
|
||||
abad.hab=abad.hab+1
|
||||
@@ -220,7 +226,7 @@ function update_game()
|
||||
elseif btnp(KEY_RETURN) then
|
||||
mode=modes.playing
|
||||
elseif btnp(KEY_S) and (btn(KEY_LCTRL) or btn(KEY_LGUI)) then
|
||||
_update=update_dialog
|
||||
game_update=update_dialog
|
||||
elseif btnp(KEY_C) then
|
||||
mapa_cycle_colors(abad.hab)
|
||||
elseif btnp(KEY_M) then
|
||||
@@ -264,7 +270,7 @@ function update_game()
|
||||
prnt("x"..abad.vides,114,13,2)
|
||||
rectfill(102+(abad.energia>>1),30,122,37,16)
|
||||
else
|
||||
sspr(0,0,16,9,50,40,16,9,true)
|
||||
blit(0,0,16,9,50,40,16,9,true)
|
||||
if abad.hurting > 40 then
|
||||
prnt("x"..abad.vides+1,63,43,3)
|
||||
elseif abad.hurting < 20 then
|
||||
@@ -292,7 +298,7 @@ function update_game()
|
||||
switches.update()
|
||||
|
||||
--local hx = abad.hab%10
|
||||
--local hy = flr(abad.hab/10)
|
||||
--local hy = math.floor(abad.hab/10)
|
||||
--if btnp(KEY_RETURN) then
|
||||
-- mode=modes.editing
|
||||
-- mapa_restore_backup()
|
||||
@@ -309,7 +315,7 @@ function update_game()
|
||||
--elseif btnp(KEY_ESCAPE) then
|
||||
-- pause()
|
||||
--end
|
||||
if btnp(KEY_ESCAPE) then
|
||||
if btnp(KEY_ESCAPE) or padp(btnPause) then
|
||||
pause()
|
||||
end
|
||||
if abad.objects.gps~=nil then
|
||||
@@ -324,27 +330,22 @@ function update_game()
|
||||
elseif btnp(KEY_5) then
|
||||
current_camera=5
|
||||
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
|
||||
|
||||
|
||||
function update_menu()
|
||||
menu_count=menu_count+1
|
||||
menu_change_room=menu_change_room-1
|
||||
if menu_change_room==0 then
|
||||
menu_room = rnd(60)
|
||||
menu_change_room=300
|
||||
end
|
||||
|
||||
cls(16)
|
||||
text("C A C A U S", 42, 12, 15)
|
||||
if menu_count<20 then
|
||||
text("Pulsa SPACE", 42, 28, 13)
|
||||
else
|
||||
text("Pulsa SPACE", 42, 28, 16)
|
||||
if menu_count>40 then menu_count=0 end
|
||||
end
|
||||
function redraw_menu_hab()
|
||||
draw_hab(menu_room,16,41)
|
||||
rectfill(0,0,14,96,16)
|
||||
rectfill(114,0,191,96,16)
|
||||
@@ -359,11 +360,49 @@ function update_menu()
|
||||
cacau.update()
|
||||
fireball.update()
|
||||
switches.update()
|
||||
end
|
||||
|
||||
if btnp(KEY_SPACE) then
|
||||
function update_menu()
|
||||
menu_change_room=menu_change_room-1
|
||||
if menu_change_room==0 then
|
||||
menu_room = rnd(60)
|
||||
menu_change_room=300
|
||||
end
|
||||
|
||||
cls(16)
|
||||
text("C A C A U S", 42, 8, 15)
|
||||
|
||||
if menu_state == 0 then
|
||||
menu_count=menu_count+1
|
||||
local parpadeig=false
|
||||
if menu_count>=20 then
|
||||
parpadeig=true
|
||||
if menu_count>40 then menu_count=0 end
|
||||
end
|
||||
if (not parpadeig or menu_sel~=0) then text("JUGAR", 54, 16, 13) end
|
||||
if (not parpadeig or menu_sel~=1) then text("REDEFINIR TECLAT", 32, 24, 13) end
|
||||
if (not parpadeig or menu_sel~=2) then text("REDEFINIR GAMEPAD", 30, 32, 13) end
|
||||
|
||||
redraw_menu_hab()
|
||||
|
||||
if btnp(keyShoot) or btnp(KEY_SPACE) or padp(BTN_A) or padp(btnShoot) then
|
||||
if menu_sel==0 then
|
||||
game_exit()
|
||||
game_init()
|
||||
fade.fadeoutin()
|
||||
elseif menu_sel==1 then
|
||||
menu_count=0
|
||||
menu_state=1
|
||||
else
|
||||
menu_count=0
|
||||
menu_state=2
|
||||
end
|
||||
elseif btnp(keyDown) or btnp(KEY_DOWN) or padp(BTN_DOWN) or padp(btnDown) then
|
||||
menu_sel=menu_sel+1
|
||||
if menu_sel==3 then menu_sel=0 end
|
||||
elseif btnp(keyUp) or btnp(KEY_UP) or padp(BTN_UP) or padp(btnUp) then
|
||||
menu_sel=menu_sel-1
|
||||
if menu_sel==-1 then menu_sel=2 end
|
||||
elseif btnp(KEY_M) then
|
||||
mute = not mute
|
||||
if mute then
|
||||
@@ -371,7 +410,121 @@ function update_menu()
|
||||
else
|
||||
playmus(audio_main_song)
|
||||
end
|
||||
elseif btnp(KEY_ESCAPE) or padp(btnPause) then
|
||||
quit()
|
||||
end
|
||||
elseif menu_state==1 then
|
||||
if btnp(KEY_ESCAPE) then
|
||||
menu_count = 0
|
||||
menu_state = 0
|
||||
end
|
||||
if menu_count==0 then
|
||||
text("PULSA TECLA PER A AMUNT", 20, 24, 13)
|
||||
local key = btnp();
|
||||
if key ~= 0 and key~=KEY_ESCAPE then
|
||||
menu_count = 1
|
||||
keyUp=key
|
||||
setconf("keyup", keyUp)
|
||||
end
|
||||
elseif menu_count==1 then
|
||||
text("PULSA TECLA PER A AVALL", 20, 24, 13)
|
||||
local key = btnp();
|
||||
if key ~= 0 and key~=KEY_ESCAPE then
|
||||
menu_count = 2
|
||||
keyDown=key
|
||||
setconf("keydown", keyDown)
|
||||
end
|
||||
elseif menu_count==2 then
|
||||
text("PULSA TECLA PER A ESQUERRA", 14, 24, 13)
|
||||
local key = btnp();
|
||||
if key ~= 0 and key~=KEY_ESCAPE then
|
||||
menu_count = 3
|
||||
keyLeft=key
|
||||
setconf("keleft", keyLeft)
|
||||
end
|
||||
elseif menu_count==3 then
|
||||
text("PULSA TECLA PER A DRETA", 20, 24, 13)
|
||||
local key = btnp();
|
||||
if key ~= 0 and key~=KEY_ESCAPE then
|
||||
menu_count = 4
|
||||
keyRight=key
|
||||
setconf("keyright", keyRight)
|
||||
end
|
||||
elseif menu_count==4 then
|
||||
text("PULSA TECLA PER A BOTAR", 20, 24, 13)
|
||||
local key = btnp();
|
||||
if key ~= 0 and key~=KEY_ESCAPE then
|
||||
menu_count = 5
|
||||
keyJump=key
|
||||
setconf("keyjump", keyJump)
|
||||
end
|
||||
elseif menu_count==5 then
|
||||
text("PULSA TECLA PER A DISPAR", 18, 24, 13)
|
||||
local key = btnp();
|
||||
if key ~= 0 and key~=KEY_ESCAPE then
|
||||
menu_count = 0
|
||||
menu_state = 0
|
||||
keyShoot=key
|
||||
setconf("keyshoot", keyShoot)
|
||||
end
|
||||
end
|
||||
else
|
||||
if btnp(KEY_ESCAPE) then
|
||||
menu_count = 0
|
||||
menu_state = 0
|
||||
end
|
||||
if menu_count==0 then
|
||||
text("PULSA BOTÓ PER A AMUNT", 22, 24, 13)
|
||||
local btn = padp();
|
||||
if btn ~= -1 then
|
||||
menu_count = 1
|
||||
btnUp=btn
|
||||
setconf("btnup", btnUp)
|
||||
end
|
||||
elseif menu_count==1 then
|
||||
text("PULSA BOTÓ PER A AVALL", 22, 24, 13)
|
||||
local btn = padp();
|
||||
if btn ~= -1 then
|
||||
menu_count = 2
|
||||
btnDown=btn
|
||||
setconf("btndown", btnDown)
|
||||
end
|
||||
elseif menu_count==2 then
|
||||
text("PULSA BOTÓ PER A ESQUERRA", 16, 24, 13)
|
||||
local btn = padp();
|
||||
if btn ~= -1 then
|
||||
menu_count = 3
|
||||
btnLeft=btn
|
||||
setconf("keleft", btnLeft)
|
||||
end
|
||||
elseif menu_count==3 then
|
||||
text("PULSA BOTÓ PER A DRETA", 22, 24, 13)
|
||||
local btn = padp();
|
||||
if btn ~= -1 then
|
||||
menu_count = 4
|
||||
btnRight=btn
|
||||
setconf("btnright", btnRight)
|
||||
end
|
||||
elseif menu_count==4 then
|
||||
text("PULSA BOTÓ PER A BOTAR", 22, 24, 13)
|
||||
local btn = padp();
|
||||
if btn ~= -1 then
|
||||
menu_count = 5
|
||||
btnJump=btn
|
||||
setconf("btnjump", btnJump)
|
||||
end
|
||||
elseif menu_count==5 then
|
||||
text("PULSA BOTÓ PER A DISPAR", 20, 24, 13)
|
||||
local btn = padp();
|
||||
if btn ~= -1 then
|
||||
menu_count = 0
|
||||
menu_state = 0
|
||||
btnShoot=btn
|
||||
setconf("btnshoot", btnShoot)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function game_exit()
|
||||
@@ -387,27 +540,42 @@ end
|
||||
function pause()
|
||||
setsource(0)
|
||||
setdest(back)
|
||||
sspr(0,0,128,96,0,0)
|
||||
blit(0,0,128,96,0,0)
|
||||
setdest(0)
|
||||
setsource(tiles)
|
||||
pause_old_update=_update
|
||||
_update=update_pause
|
||||
pausa_option=1
|
||||
pause_old_update=game_update
|
||||
game_update=update_pause
|
||||
end
|
||||
|
||||
function update_pause()
|
||||
rectfill(16,16,112,80,16)
|
||||
rect(16,16,112,80,15)
|
||||
prnt("PAUSA",54,30,15)
|
||||
prnt("ESC torna al joc",30,50,14)
|
||||
prnt("SPACE eixir",30,60,14)
|
||||
if pausa_option==1 then
|
||||
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
|
||||
setsource(back)
|
||||
sspr(0,0,128,96,0,0)
|
||||
blit(0,0,128,96,0,0)
|
||||
setsource(tiles)
|
||||
_update = pause_old_update
|
||||
elseif btnp(KEY_SPACE) then
|
||||
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
|
||||
if pausa_option==1 then
|
||||
setsource(back)
|
||||
blit(0,0,128,96,0,0)
|
||||
setsource(tiles)
|
||||
game_update = pause_old_update
|
||||
else
|
||||
game_exit()
|
||||
game_init(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -10,7 +10,7 @@ function gorro.init()
|
||||
end
|
||||
|
||||
function gorro.draw()
|
||||
sspr(96,32,16,16,gorro.x,gorro.y,16,16)
|
||||
blit(96,32,16,16,gorro.x,gorro.y,16,16)
|
||||
end
|
||||
|
||||
function gorro.update()
|
||||
|
||||
@@ -5,7 +5,7 @@ function gota.new(_hab,_x,_y,_freq)
|
||||
end
|
||||
|
||||
function gota:draw_normal()
|
||||
sspr(112,0,8,8,self.x,self.y)
|
||||
blit(112,0,8,8,self.x,self.y)
|
||||
end
|
||||
|
||||
function gota:update_normal()
|
||||
|
||||
@@ -10,7 +10,7 @@ function gps.init()
|
||||
end
|
||||
|
||||
function gps.draw()
|
||||
sspr(112,48,16,16,gps.x,gps.y,16,16)
|
||||
blit(112,48,16,16,gps.x,gps.y,16,16)
|
||||
end
|
||||
|
||||
function gps.update()
|
||||
|
||||
@@ -44,7 +44,7 @@ end
|
||||
|
||||
function imp.draw()
|
||||
if imp.enabled then
|
||||
sspr((imp.frame&7)*16,(imp.frame>>3)*16,16,16,imp.x,imp.y,16,16,imp.flip)
|
||||
blit((imp.frame&7)*16,(imp.frame>>3)*16,16,16,imp.x,imp.y,16,16,imp.flip)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
require "fade"
|
||||
require "game"
|
||||
require "mapa"
|
||||
require "scenes"
|
||||
|
||||
intro_wait=40
|
||||
intro_step=0
|
||||
|
||||
function intro_init()
|
||||
_update = intro_intro
|
||||
game_update = intro_intro
|
||||
intro_wait=400
|
||||
cls(16)
|
||||
setdest(logo)
|
||||
@@ -10,7 +15,7 @@ function intro_init()
|
||||
prnt("JAILGAMES",0,0,15)
|
||||
setdest(0)
|
||||
setsource(logo)
|
||||
sspr(0,0,36,5,28,35,72,10)
|
||||
blit(0,0,36,5,28,35,72,10)
|
||||
setsource(tiles)
|
||||
fade.fadein()
|
||||
end
|
||||
@@ -19,9 +24,9 @@ function intro_intro()
|
||||
--text("JAILGAMES",40,30,15)
|
||||
text("presenta",48,50,14)
|
||||
intro_wait=intro_wait-1
|
||||
if intro_wait==0 or btnp(KEY_ESCAPE) or btnp(KEY_SPACE) then
|
||||
if intro_wait==0 or btnp(KEY_ESCAPE) or btnp(keyShoot) or padp(btnShoot) or padp(btnPause) then
|
||||
intro_wait=1
|
||||
_update = intro_update
|
||||
game_update = intro_update
|
||||
fade.fadeoutin()
|
||||
end
|
||||
if btnp(KEY_M) then
|
||||
@@ -30,7 +35,7 @@ function intro_intro()
|
||||
end
|
||||
|
||||
function intro_update()
|
||||
if btnp(KEY_ESCAPE) then
|
||||
if btnp(KEY_ESCAPE) or padp(btnPause) then
|
||||
game_init(true)
|
||||
fade.fadeoutin()
|
||||
elseif btnp(KEY_SPACE) then
|
||||
@@ -47,7 +52,7 @@ function intro_update()
|
||||
camera(-16,-4)
|
||||
mapa_draw(10)
|
||||
rectfill(73,24,79,39,16)
|
||||
sspr(0,0,16,16,44,24,16,16,true)
|
||||
blit(0,0,16,16,44,24,16,16,true)
|
||||
camera(0,0)
|
||||
intro_step=intro_step+1
|
||||
elseif intro_step==1 then
|
||||
@@ -59,7 +64,7 @@ function intro_update()
|
||||
camera(-16,-4)
|
||||
mapa_draw(10)
|
||||
rectfill(73,24,79,39,16)
|
||||
sspr(0,0,16,16,44,24,16,16,false)
|
||||
blit(0,0,16,16,44,24,16,16,false)
|
||||
camera(0,0)
|
||||
intro_step=intro_step+1
|
||||
elseif intro_step==3 then
|
||||
@@ -71,9 +76,9 @@ function intro_update()
|
||||
camera(-16,-4)
|
||||
mapa_draw(10)
|
||||
rectfill(73,24,79,39,16)
|
||||
sspr(0,0,16,16,44,24,16,16,false)
|
||||
sspr(112,88,16,8,76,32,16,8,true)
|
||||
sspr(0,48,16,16,82,24,16,16,true)
|
||||
blit(0,0,16,16,44,24,16,16,false)
|
||||
blit(112,88,16,8,76,32,16,8,true)
|
||||
blit(0,48,16,16,82,24,16,16,true)
|
||||
camera(0,0)
|
||||
intro_step=intro_step+1
|
||||
elseif intro_step==5 then
|
||||
@@ -85,7 +90,7 @@ function intro_update()
|
||||
camera(-16,-4)
|
||||
mapa_draw(10)
|
||||
rectfill(73,24,79,39,16)
|
||||
sspr(0,0,16,16,44,24,16,16,false)
|
||||
blit(0,0,16,16,44,24,16,16,false)
|
||||
camera(0,0)
|
||||
intro_step=intro_step+1
|
||||
elseif intro_step==7 then
|
||||
|
||||
@@ -1,3 +1,36 @@
|
||||
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()
|
||||
tiles=loadsurf("tiles.gif")
|
||||
setsource(tiles)
|
||||
@@ -24,9 +57,52 @@ function _init()
|
||||
audio_hit = loadsound(audio_hit)
|
||||
audio_low = loadsound(audio_low)
|
||||
|
||||
keyUp = tonumber(getconf("keyup")) or KEY_UP
|
||||
keyDown = tonumber(getconf("keydown")) or KEY_DOWN
|
||||
keyLeft = tonumber(getconf("keyleft")) or KEY_LEFT
|
||||
keyRight = tonumber(getconf("keyright")) or KEY_RIGHT
|
||||
keyJump = tonumber(getconf("keyjump")) or KEY_UP
|
||||
keyShoot = tonumber(getconf("keyshoot")) or KEY_SPACE
|
||||
|
||||
btnUp = tonumber(getconf("btnup")) or BTN_UP
|
||||
btnDown = tonumber(getconf("btndown")) or BTN_DOWN
|
||||
btnLeft = tonumber(getconf("btnleft")) or BTN_LEFT
|
||||
btnRight = tonumber(getconf("btnright")) or BTN_RIGHT
|
||||
btnJump = tonumber(getconf("btnjump")) or BTN_B
|
||||
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()
|
||||
intro_init()
|
||||
--final_init()
|
||||
end
|
||||
|
||||
function _update() end
|
||||
function _update()
|
||||
if btnp(KEY_F1) then
|
||||
zoom(zoom()-1)
|
||||
elseif btnp(KEY_F2) then
|
||||
zoom(zoom()+1)
|
||||
elseif btnp(KEY_F3) then
|
||||
local fs = fullscreen()
|
||||
fullscreen(not fs)
|
||||
cursor(fs)
|
||||
end
|
||||
|
||||
if (game_update) then game_update() 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
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
--mapa={}
|
||||
require "map"
|
||||
|
||||
tiletype={void=0,nonpc=1,stair=2,switch=3,half=4,block=5}
|
||||
mapa.wait=0
|
||||
mapa.step=0
|
||||
@@ -92,7 +93,7 @@ function mapa_draw(hab)
|
||||
for tx=0,11 do
|
||||
local tile=mapa[1+hab][1+tx+ty*12]
|
||||
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)
|
||||
blit((tile&15)*8,64+(tile>>4)*8,8,8,tx*8,ty*8)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -124,8 +125,8 @@ function mapa_cycle_colors(hab)
|
||||
end
|
||||
|
||||
function check_tile(hab,x,y)
|
||||
local xx=min(11,max(0,flr(x/8)))
|
||||
local yy=min(5,max(0,flr(y/8)))
|
||||
local xx=math.min(11,math.max(0,math.floor(x/8)))
|
||||
local yy=math.min(5,math.max(0,math.floor(y/8)))
|
||||
--rect(xx*8,yy*8,xx*8+8,yy*8+8,3)
|
||||
|
||||
local tile=mapa_get_tile(hab,xx,yy)
|
||||
@@ -157,12 +158,12 @@ function mapa_create_minimap()
|
||||
print(x..","..y.."="..tile)
|
||||
end
|
||||
if tile<64 then
|
||||
pset(x+(h%10)*12,y+flr(h/10)*6,pix[1+tile])
|
||||
pset(x+(h%10)*12,y+math.floor(h/10)*6,pix[1+tile])
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
_update=mapa_draw_minimap
|
||||
game_update=mapa_draw_minimap
|
||||
end
|
||||
|
||||
function mapa_draw_minimap()
|
||||
@@ -170,5 +171,5 @@ function mapa_draw_minimap()
|
||||
setsource(minimap)
|
||||
setdest(0)
|
||||
cls(16)
|
||||
sspr(0,0,128,96,0,0)
|
||||
blit(0,0,128,96,0,0)
|
||||
end
|
||||
@@ -10,7 +10,7 @@ function peu.init()
|
||||
end
|
||||
|
||||
function peu.draw()
|
||||
sspr(112,32,16,16,peu.x,peu.y,16,16)
|
||||
blit(112,32,16,16,peu.x,peu.y,16,16)
|
||||
end
|
||||
|
||||
function peu.update()
|
||||
|
||||
@@ -14,7 +14,7 @@ function premiere.init()
|
||||
end
|
||||
|
||||
function premiere.draw()
|
||||
sspr((premiere.frame&7)*16,(premiere.frame>>3)*16,16,16,premiere.x,premiere.y,16,16,premiere.flip)
|
||||
blit((premiere.frame&7)*16,(premiere.frame>>3)*16,16,16,premiere.x,premiere.y,16,16,premiere.flip)
|
||||
end
|
||||
|
||||
function premiere.hit()
|
||||
@@ -145,8 +145,8 @@ function premiere.update_falling()
|
||||
end
|
||||
end
|
||||
|
||||
local xx=flr((premiere.x+4)/8)
|
||||
local yy=flr((premiere.y+16)/8)
|
||||
local xx=math.floor((premiere.x+4)/8)
|
||||
local yy=math.floor((premiere.y+16)/8)
|
||||
|
||||
if premiere.y<32 then
|
||||
if (premiere.y+16)&7==0 and (check_tile(premiere.hab,premiere.x+4,premiere.y+16)>=tiletype.half or ((premiere.x+4)&7~=0 and check_tile(premiere.hab,premiere.x+12,premiere.y+16)>=tiletype.half)) then
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
require "final"
|
||||
require "audio"
|
||||
|
||||
scenes={
|
||||
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},
|
||||
@@ -129,7 +132,7 @@ function start_scene(scene,offset)
|
||||
--bkg=newsurf(128,96)
|
||||
--setdest(bkg)
|
||||
--setsource(0)
|
||||
--sspr(0,0,128,96,0,0)
|
||||
--blit(0,0,128,96,0,0)
|
||||
--setsource(tiles)
|
||||
--setdest(0)
|
||||
scenes.current_scene=scene
|
||||
@@ -144,8 +147,8 @@ function start_scene(scene,offset)
|
||||
playmus(scenes.current_scene[scenes.dnum].musica)
|
||||
end
|
||||
if offset then scenes.offset=offset end
|
||||
old_update=_update
|
||||
_update=update_scene
|
||||
old_update=game_update
|
||||
game_update=update_scene
|
||||
end
|
||||
|
||||
function playtext(snd)
|
||||
@@ -178,18 +181,18 @@ function draw_scene()
|
||||
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)
|
||||
blit(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)
|
||||
blit(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)
|
||||
blit(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)
|
||||
blit(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)
|
||||
@@ -224,10 +227,10 @@ function draw_scene()
|
||||
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)
|
||||
blit(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)
|
||||
blit(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)
|
||||
@@ -254,7 +257,7 @@ function update_scene()
|
||||
final_init()
|
||||
fade.fadeoutin()
|
||||
else
|
||||
_update=old_update
|
||||
game_update=old_update
|
||||
end
|
||||
else
|
||||
scenes.dnum=scenes.dnum+1
|
||||
@@ -263,8 +266,8 @@ function update_scene()
|
||||
end
|
||||
end
|
||||
else
|
||||
if flr(time()*2)%2==0 then
|
||||
sspr(104,88,7,5,118,56)
|
||||
if math.floor(time()*2)%2==0 then
|
||||
blit(104,88,7,5,118,56)
|
||||
else
|
||||
rectfill(118,56,125,61,12)
|
||||
end
|
||||
@@ -272,7 +275,7 @@ function update_scene()
|
||||
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
|
||||
game_init(true)
|
||||
else
|
||||
@@ -283,21 +286,22 @@ function update_scene()
|
||||
end
|
||||
|
||||
if scenes.step>8 then
|
||||
if btnp(KEY_SPACE) or btnp(KEY_DOWN) or btnp(KEY_UP) or btnp(KEY_LEFT) or btnp(KEY_RIGHT) or btnp(KEY_RETURN) then
|
||||
if btnp(keyShoot) or btnp(keyDown) or btnp(keyUp) or btnp(keyLeft) or btnp(keyRight) or btnp(KEY_RETURN) or
|
||||
padp(btnShoot) or padp(btnDown) or padp(btnUp) or padp(btnLeft) or padp(btnRight) then
|
||||
if scenes.dnum==#scenes.current_scene then
|
||||
stopmusic()
|
||||
if batman.endgame then
|
||||
final_init()
|
||||
fade.fadeoutin()
|
||||
else
|
||||
_update=old_update
|
||||
game_update=old_update
|
||||
end
|
||||
else
|
||||
scenes.dnum=scenes.dnum+1
|
||||
scenes.step=2
|
||||
end
|
||||
end
|
||||
elseif btnp(KEY_SPACE) then
|
||||
elseif btnp(keyShoot) or padp(btnShoot) then
|
||||
scenes.step=8
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,17 +4,17 @@ function score.create()
|
||||
score.surf=newsurf(32,96)
|
||||
setdest(score.surf)
|
||||
cls(16)
|
||||
sspr(0,0,16,9,5,9,16,9,true)
|
||||
spr(132,0,0,1,1) spr(150,8,0,1,1) spr(150,16,0,1,1) spr(133,24,0,1,1)
|
||||
spr(134,0,8,1,1) spr(135,24,8,1,1) spr(134,0,16,1,1) spr(135,24,16,1,1)
|
||||
spr(132,0,24,1,1) spr(150,8,24,1,1) spr(150,16,24,1,1) spr(133,24,24,1,1)
|
||||
spr(134,0,32,1,1) spr(135,24,32,1,1)
|
||||
spr(132,0,40,1,1) spr(150,8,40,1,1) spr(150,16,40,1,1) spr(133,24,40,1,1)
|
||||
blit(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)
|
||||
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)
|
||||
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)
|
||||
blit(48,64,8,8,0,32) blit(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)
|
||||
|
||||
spr(134,0,48,1,1) spr(135,24,48,1,1) spr(134,0,56,1,1) spr(135,24,56,1,1)
|
||||
spr(134,0,64,1,1) spr(135,24,64,1,1) --spr(134,0,72,1,1) spr(135,24,72,1,1)
|
||||
spr(132,0,72,1,1) spr(150,8,72,1,1) spr(150,16,72,1,1) spr(133,24,72,1,1)
|
||||
spr(134,0,80,1,1) spr(135,24,80,1,1) spr(134,0,88,1,1) spr(135,24,88,1,1)
|
||||
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)
|
||||
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)
|
||||
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)
|
||||
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)
|
||||
prnt("jail",6,77,2)
|
||||
prnt("games",8, 82,2)
|
||||
prnt("2023",9,89,1)
|
||||
@@ -30,14 +30,14 @@ end
|
||||
|
||||
function score.draw()
|
||||
setsource(score.surf)
|
||||
sspr(0,0,32,96,96,0)
|
||||
blit(0,0,32,96,96,0)
|
||||
setsource(tiles)
|
||||
if abad.objects.gorro~=nil then sspr(96,32,16,16,99,44) end
|
||||
if abad.objects.peu~=nil then sspr(112,32,16,16,109,44) end
|
||||
if abad.objects.gps~=nil then sspr(112,48,16,16,100,55) end
|
||||
if abad.objects.gorro~=nil then blit(96,32,16,16,99,44) end
|
||||
if abad.objects.peu~=nil then blit(112,32,16,16,109,44) end
|
||||
if abad.objects.gps~=nil then blit(112,48,16,16,100,55) end
|
||||
|
||||
if abad.objects.clau_premiere~=nil then sspr(112,8,8,8,104,48) end
|
||||
if abad.objects.clau_elalien~=nil then sspr(120,8,8,8,112,48) end
|
||||
if abad.objects.clau_premiere~=nil then blit(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.bol~=nil then sspr(112,88,16,8,104,46) end
|
||||
if abad.objects.bol~=nil then blit(112,88,16,8,104,46) end
|
||||
end
|
||||
@@ -5,7 +5,7 @@ function zombie.new(_hab,_x,_y,_flip)
|
||||
end
|
||||
|
||||
function zombie:draw()
|
||||
if self.frame>0 then sspr((self.frame&7)*16,(self.frame>>3)*16,16,16,self.x,self.y,16,16,self.flip) end
|
||||
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
|
||||
end
|
||||
|
||||
function zombie:update_normal()
|
||||
|
||||
Reference in New Issue
Block a user