- Ja funciona en la ultima versió de mini (v0.9.95d)

This commit is contained in:
2024-11-24 20:21:14 +01:00
parent 75a1fb95d9
commit 9afc51f9a0
20 changed files with 81 additions and 81 deletions

View File

@@ -18,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
@@ -226,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
@@ -236,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
@@ -274,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

View File

@@ -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

View File

@@ -15,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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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,
@@ -48,9 +48,9 @@ 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
@@ -70,7 +70,7 @@ fade = {
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,9 +84,9 @@ 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

View File

@@ -9,8 +9,8 @@ function final_init()
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()

View File

@@ -206,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
@@ -270,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
@@ -298,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()
@@ -540,7 +540,7 @@ 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)
pausa_option=1
@@ -562,7 +562,7 @@ function update_pause()
if btnp(KEY_ESCAPE) then
setsource(back)
sspr(0,0,128,96,0,0)
blit(0,0,128,96,0,0)
setsource(tiles)
game_update = pause_old_update
elseif btnp(keyDown) or btnp(keyUp) or padp(btnDown) or padp(btnUp) then
@@ -570,7 +570,7 @@ function update_pause()
elseif btnp(keyShoot) or padp(btnShoot) then
if pausa_option==1 then
setsource(back)
sspr(0,0,128,96,0,0)
blit(0,0,128,96,0,0)
setsource(tiles)
game_update = pause_old_update
else

View File

@@ -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()

View File

@@ -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()

View File

@@ -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()

View File

@@ -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

View File

@@ -15,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
@@ -52,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
@@ -64,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
@@ -76,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
@@ -90,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

View File

@@ -93,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
@@ -125,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)
@@ -158,7 +158,7 @@ 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
@@ -171,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

View File

@@ -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()

View File

@@ -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

View File

@@ -132,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
@@ -181,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)
@@ -227,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)
@@ -266,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

View File

@@ -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

View File

@@ -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()