Compare commits
No commits in common. "dee31bf52f60d07d4fdf0fcdabd87023f8b7591c" and "09ef3617f78873a0c404569ee22d940378617d33" have entirely different histories.
dee31bf52f
...
09ef3617f7
@ -107,6 +107,8 @@ function print3(s,y,w)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function cyclenum(n,low,up)
|
function cyclenum(n,low,up)
|
||||||
|
low=low or 1
|
||||||
|
up=up or low+1
|
||||||
return(n-low)%(up-low+1)+low
|
return(n-low)%(up-low+1)+low
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -1261,8 +1263,7 @@ function init_menu()
|
|||||||
|
|
||||||
bg.set("falling")
|
bg.set("falling")
|
||||||
gstate=1
|
gstate=1
|
||||||
gamev,mode,slc={sprite={}},mode or dget(63),1
|
gamev,mode,slc={sprite={}},mode or 1,1
|
||||||
if (mode<1) mode=1
|
|
||||||
|
|
||||||
options=options or {
|
options=options or {
|
||||||
gamev={},
|
gamev={},
|
||||||
@ -1364,22 +1365,21 @@ function update_menu()
|
|||||||
sfx"12"
|
sfx"12"
|
||||||
end
|
end
|
||||||
--start game
|
--start game
|
||||||
if slc <= 2 then
|
if 1==slc then
|
||||||
if confirm()then
|
if confirm()then
|
||||||
dset(63,mode)
|
|
||||||
cpt(modes[modes.list[mode]],gamev)
|
cpt(modes[modes.list[mode]],gamev)
|
||||||
init_game(gamev)
|
init_game(gamev)
|
||||||
end
|
end
|
||||||
if slc == 2 then
|
--mode selection
|
||||||
if btnp"0"then
|
elseif 2==slc then
|
||||||
sfx"13"
|
if btnp"0"then
|
||||||
mode-=1
|
sfx"13"
|
||||||
if(0==mode)mode=#modes.list
|
mode-=1
|
||||||
elseif btnp"1"then
|
if(0==mode)mode=#modes.list
|
||||||
sfx"13"
|
elseif btnp"1"then
|
||||||
mode%=#modes.list
|
sfx"13"
|
||||||
mode+=1
|
mode%=#modes.list
|
||||||
end
|
mode+=1
|
||||||
end
|
end
|
||||||
--option menu
|
--option menu
|
||||||
elseif 3==slc and confirm()then
|
elseif 3==slc and confirm()then
|
||||||
@ -2002,7 +2002,6 @@ anim={
|
|||||||
swooshes={},
|
swooshes={},
|
||||||
|
|
||||||
new=function(t,a)
|
new=function(t,a)
|
||||||
if (debris==3 and t=="crush") return
|
|
||||||
local listname = t.."es"
|
local listname = t.."es"
|
||||||
a.type,a.new,a.next=t,true,anim[listname].next
|
a.type,a.new,a.next=t,true,anim[listname].next
|
||||||
anim[listname].next=a
|
anim[listname].next=a
|
||||||
@ -2012,14 +2011,12 @@ anim={
|
|||||||
draw=function()
|
draw=function()
|
||||||
--drawing in correct order
|
--drawing in correct order
|
||||||
for t in all({"swoosh","crush"})do
|
for t in all({"swoosh","crush"})do
|
||||||
local afxn,prev=anim[t],anim[t.."es"]
|
local lnm = t.."es"
|
||||||
|
local prev=anim[lnm]
|
||||||
local curr=prev.next
|
local curr=prev.next
|
||||||
while curr do
|
while curr do
|
||||||
if not curr.wait and not afxn(curr) then
|
if (not curr.wait and not anim[t](curr)) prev.next=curr.next
|
||||||
prev.next=curr.next
|
prev=curr
|
||||||
else
|
|
||||||
prev=curr
|
|
||||||
end
|
|
||||||
curr=curr.next
|
curr=curr.next
|
||||||
end
|
end
|
||||||
poke2(0x5f06,0x706)
|
poke2(0x5f06,0x706)
|
||||||
@ -2042,7 +2039,8 @@ anim={
|
|||||||
|
|
||||||
swoosh=function(a)
|
swoosh=function(a)
|
||||||
local baseframes = 10/clrspd --10 wide
|
local baseframes = 10/clrspd --10 wide
|
||||||
if a.age > baseframes+5 then
|
local totalframes = baseframes+5 --5 swooshclrs
|
||||||
|
if a.age > totalframes then
|
||||||
dirty=true
|
dirty=true
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
@ -2060,9 +2058,11 @@ anim={
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
crush=function(a)
|
crush=function(a)
|
||||||
|
if (debris==3) return false
|
||||||
if (a.lag>0) return true
|
if (a.lag>0) return true
|
||||||
poke2(0x5f06,a.c)
|
poke2(0x5f06,a.c)
|
||||||
local spr_base,ret = 8*sprite.normal,false
|
local spr_base = 8*sprite.normal
|
||||||
|
local ret = false
|
||||||
for p in all(a.list) do
|
for p in all(a.list) do
|
||||||
ret = ret or p.y<128
|
ret = ret or p.y<128
|
||||||
sspr(spr_base+p.i%2*3,p.i\2*3,3,3,p.x,p.y)
|
sspr(spr_base+p.i%2*3,p.i\2*3,3,3,p.x,p.y)
|
||||||
@ -2081,14 +2081,12 @@ end
|
|||||||
|
|
||||||
function upd_crush(a)
|
function upd_crush(a)
|
||||||
if a.list==nil then
|
if a.list==nil then
|
||||||
local c2=clrspd/2
|
|
||||||
a.list = {
|
a.list = {
|
||||||
{i=0,x=a.x,y=a.y,dx=-rnd(c2),dy=(rnd(1)-1.5)},
|
{i=0,x=a.x,y=a.y,dx=-rnd(0.5),dy=rnd(1)-1.5},
|
||||||
{i=1,x=a.x+3,y=a.y,dx=rnd(c2),dy=(rnd(1)-1.5)},
|
{i=1,x=a.x+3,y=a.y,dx=rnd(0.5),dy=rnd(1)-1.5},
|
||||||
{i=3,x=a.x+3,y=a.y+3,dx=rnd(c2),dy=(rnd(1)-0.5)},
|
{i=3,x=a.x+3,y=a.y+3,dx=rnd(0.5),dy=rnd(1)-0.5},
|
||||||
{i=2,x=a.x,y=a.y+3,dx=-rnd(c2),dy=(rnd(1)-0.5)}
|
{i=2,x=a.x,y=a.y+3,dx=-rnd(0.5),dy=rnd(1)-0.5}
|
||||||
}
|
}
|
||||||
a.g=0.075*clrspd
|
|
||||||
if debris==2 then
|
if debris==2 then
|
||||||
deli(a.list,irnd1(4))
|
deli(a.list,irnd1(4))
|
||||||
deli(a.list,irnd1(3))
|
deli(a.list,irnd1(3))
|
||||||
@ -2101,7 +2099,7 @@ function upd_crush(a)
|
|||||||
for p in all(a.list) do
|
for p in all(a.list) do
|
||||||
p.x+=p.dx
|
p.x+=p.dx
|
||||||
p.y+=p.dy
|
p.y+=p.dy
|
||||||
p.dy+=a.g
|
p.dy+=0.075
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user