Made level counter more readable + added level overflow mechanic
This commit is contained in:
@@ -1,3 +1,28 @@
|
||||
local function GetLevelStr(lvl)
|
||||
local list={"01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","00","0A","14","1E","28","32","3C","46","50","5A","64","6E","78","82","8C","96","A0","AA","B4","BE","C6","20","E6","20","06","21","26","21","46","21","66","21","86","21","A6","21","C6","21","E6","21","06","22","26","22","46","22","66","22","86","22","A6","22","C6","22","E6","22","06","23","26","23","85","A8","29","F0","4A","4A","4A","4A","8D","07","20","A5","A8","29","0F","8D","07","20","60","A6","49","E0","15","10","53","BD","D6","96","A8","8A","0A","AA","E8","BD","EA","96","8D","06","20","CA","A5","BE","C9","01","F0","1E","A5","B9","C9","05","F0","0C","BD","EA","96","38","E9","02","8D","06","20","4C","67","97","BD","EA","96","18","69","0C","8D","06","20","4C","67","97","BD","EA","96","18","69","06","8D","06","20","A2","0A","B1","B8","8D","07","20","C8","CA","D0","F7","E6","49","A5","49","C9","14","30","04","A9","20","85","49","60","A5","B1","29","03","D0","78","A9","00","85","AA","A6","AA","B5","4A","F0","5C","0A","A8","B9","EA","96","85","A8","A5","BE","C9","01","D0","0A","A5","A8","18","69","06","85","A8","4C","BD","97","A5","B9","C9","04","D0","0A","A5","A8","38","E9","02","85","A8","4C","BD","97","A5","A8"}
|
||||
list[0]="00"
|
||||
lvl=lvl%256
|
||||
return list[lvl]
|
||||
end
|
||||
local function GetGravity(lvl)
|
||||
lvl=lvl%256
|
||||
return
|
||||
lvl==0 and 48 or
|
||||
lvl==1 and 43 or
|
||||
lvl==2 and 38 or
|
||||
lvl==3 and 33 or
|
||||
lvl==4 and 28 or
|
||||
lvl==5 and 23 or
|
||||
lvl==6 and 18 or
|
||||
lvl==7 and 13 or
|
||||
lvl==8 and 8 or
|
||||
lvl==9 and 6 or
|
||||
lvl<13 and 5 or
|
||||
lvl<16 and 4 or
|
||||
lvl<19 and 3 or
|
||||
lvl<29 and 2 or
|
||||
1
|
||||
end
|
||||
local gc_setColor=love.graphics.setColor
|
||||
return{
|
||||
das=16,arr=6,
|
||||
@@ -15,8 +40,7 @@ return{
|
||||
keyCancel={5,6},
|
||||
mesDisp=function(P)
|
||||
setFont(75)
|
||||
local r=P.modeData.target/10
|
||||
mStr(r<10 and 9 or r<30 and r or("%02x"):format(r*10-300),63,210)
|
||||
mStr(GetLevelStr(P.modeData.lvl),63,210)
|
||||
mText(TEXTOBJ.speedLV,63,290)
|
||||
PLY.draw.drawProgress(P.stat.row,P.modeData.target)
|
||||
if P.modeData.drought>7 then
|
||||
@@ -32,27 +56,22 @@ return{
|
||||
end
|
||||
end,
|
||||
task=function(P)
|
||||
P.modeData.lvl=9
|
||||
P.modeData.target=10
|
||||
end,
|
||||
hook_drop=function(P)
|
||||
local D=P.modeData
|
||||
D.drought=P.lastPiece.id==7 and 0 or D.drought+1
|
||||
if P.stat.row>=D.target then
|
||||
if D.target==110 then
|
||||
P.gameEnv.drop,P.gameEnv.lock=5,5
|
||||
P.gameEnv.sddas,P.gameEnv.sdarr=5,5
|
||||
if D.target>=100 then
|
||||
D.lvl=D.lvl+1
|
||||
end
|
||||
local dropSpd=GetGravity(D.lvl)
|
||||
if D.target==200 then P.win('finish') return
|
||||
elseif dropSpd~=P.gameEnv.drop then
|
||||
P.gameEnv.drop,P.gameEnv.lock=dropSpd,dropSpd
|
||||
P.gameEnv.sddas,P.gameEnv.sdarr=dropSpd,dropSpd
|
||||
SFX.play('warn_2',.7)
|
||||
elseif D.target==140 then
|
||||
P.gameEnv.drop,P.gameEnv.lock=4,4
|
||||
P.gameEnv.sddas,P.gameEnv.sdarr=4,4
|
||||
SFX.play('warn_2',.7)
|
||||
elseif D.target==170 then
|
||||
P.gameEnv.drop,P.gameEnv.lock=3,3
|
||||
P.gameEnv.sddas,P.gameEnv.sdarr=3,3
|
||||
SFX.play('warn_2',.7)
|
||||
elseif D.target==200 then
|
||||
P:win('finish')
|
||||
return
|
||||
else
|
||||
SFX.play('reach')
|
||||
end
|
||||
|
||||
@@ -1,3 +1,28 @@
|
||||
local function GetLevelStr(lvl)
|
||||
local list={"01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","00","0A","14","1E","28","32","3C","46","50","5A","64","6E","78","82","8C","96","A0","AA","B4","BE","C6","20","E6","20","06","21","26","21","46","21","66","21","86","21","A6","21","C6","21","E6","21","06","22","26","22","46","22","66","22","86","22","A6","22","C6","22","E6","22","06","23","26","23","85","A8","29","F0","4A","4A","4A","4A","8D","07","20","A5","A8","29","0F","8D","07","20","60","A6","49","E0","15","10","53","BD","D6","96","A8","8A","0A","AA","E8","BD","EA","96","8D","06","20","CA","A5","BE","C9","01","F0","1E","A5","B9","C9","05","F0","0C","BD","EA","96","38","E9","02","8D","06","20","4C","67","97","BD","EA","96","18","69","0C","8D","06","20","4C","67","97","BD","EA","96","18","69","06","8D","06","20","A2","0A","B1","B8","8D","07","20","C8","CA","D0","F7","E6","49","A5","49","C9","14","30","04","A9","20","85","49","60","A5","B1","29","03","D0","78","A9","00","85","AA","A6","AA","B5","4A","F0","5C","0A","A8","B9","EA","96","85","A8","A5","BE","C9","01","D0","0A","A5","A8","18","69","06","85","A8","4C","BD","97","A5","B9","C9","04","D0","0A","A5","A8","38","E9","02","85","A8","4C","BD","97","A5","A8"}
|
||||
list[0]="00"
|
||||
lvl=lvl%256
|
||||
return list[lvl]
|
||||
end
|
||||
local function GetGravity(lvl)
|
||||
lvl=lvl%256
|
||||
return
|
||||
lvl==0 and 48 or
|
||||
lvl==1 and 43 or
|
||||
lvl==2 and 38 or
|
||||
lvl==3 and 33 or
|
||||
lvl==4 and 28 or
|
||||
lvl==5 and 23 or
|
||||
lvl==6 and 18 or
|
||||
lvl==7 and 13 or
|
||||
lvl==8 and 8 or
|
||||
lvl==9 and 6 or
|
||||
lvl<13 and 5 or
|
||||
lvl<16 and 4 or
|
||||
lvl<19 and 3 or
|
||||
lvl<29 and 2 or
|
||||
1
|
||||
end
|
||||
local gc_setColor=love.graphics.setColor
|
||||
return{
|
||||
das=16,arr=6,
|
||||
@@ -15,8 +40,7 @@ return{
|
||||
keyCancel={5,6},
|
||||
mesDisp=function(P)
|
||||
setFont(75)
|
||||
local r=P.modeData.target/10
|
||||
mStr(r<11 and 18 or r<22 and r+8 or("%02x"):format(r*10-220),63,210)
|
||||
mStr(GetLevelStr(P.modeData.lvl),63,210)
|
||||
mText(TEXTOBJ.speedLV,63,290)
|
||||
PLY.draw.drawProgress(P.stat.row,P.modeData.target)
|
||||
if P.modeData.drought>7 then
|
||||
@@ -32,19 +56,22 @@ return{
|
||||
end
|
||||
end,
|
||||
task=function(P)
|
||||
P.modeData.lvl=18
|
||||
P.modeData.target=10
|
||||
end,
|
||||
hook_drop=function(P)
|
||||
local D=P.modeData
|
||||
D.drought=P.lastPiece.id==7 and 0 or D.drought+1
|
||||
if P.stat.row>=D.target then
|
||||
if D.target==100 then
|
||||
P.gameEnv.drop,P.gameEnv.lock=2,2
|
||||
P.gameEnv.sddas,P.gameEnv.sdarr=2,2
|
||||
if D.target>=100 then
|
||||
D.lvl=D.lvl+1
|
||||
end
|
||||
local dropSpd=GetGravity(D.lvl)
|
||||
if D.target==200 then P.win('finish') return
|
||||
elseif dropSpd~=P.gameEnv.drop then
|
||||
P.gameEnv.drop,P.gameEnv.lock=dropSpd,dropSpd
|
||||
P.gameEnv.sddas,P.gameEnv.sdarr=dropSpd,dropSpd
|
||||
SFX.play('warn_1')
|
||||
elseif D.target==200 then
|
||||
P:win('finish')
|
||||
return
|
||||
else
|
||||
SFX.play('reach')
|
||||
end
|
||||
|
||||
@@ -1,23 +1,46 @@
|
||||
local function GetLevelStr(lvl)
|
||||
local list={"01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","00","0A","14","1E","28","32","3C","46","50","5A","64","6E","78","82","8C","96","A0","AA","B4","BE","C6","20","E6","20","06","21","26","21","46","21","66","21","86","21","A6","21","C6","21","E6","21","06","22","26","22","46","22","66","22","86","22","A6","22","C6","22","E6","22","06","23","26","23","85","A8","29","F0","4A","4A","4A","4A","8D","07","20","A5","A8","29","0F","8D","07","20","60","A6","49","E0","15","10","53","BD","D6","96","A8","8A","0A","AA","E8","BD","EA","96","8D","06","20","CA","A5","BE","C9","01","F0","1E","A5","B9","C9","05","F0","0C","BD","EA","96","38","E9","02","8D","06","20","4C","67","97","BD","EA","96","18","69","0C","8D","06","20","4C","67","97","BD","EA","96","18","69","06","8D","06","20","A2","0A","B1","B8","8D","07","20","C8","CA","D0","F7","E6","49","A5","49","C9","14","30","04","A9","20","85","49","60","A5","B1","29","03","D0","78","A9","00","85","AA","A6","AA","B5","4A","F0","5C","0A","A8","B9","EA","96","85","A8","A5","BE","C9","01","D0","0A","A5","A8","18","69","06","85","A8","4C","BD","97","A5","B9","C9","04","D0","0A","A5","A8","38","E9","02","85","A8","4C","BD","97","A5","A8"}
|
||||
list[0]="00"
|
||||
lvl=lvl%256
|
||||
return list[lvl]
|
||||
end
|
||||
local function GetGravity(lvl)
|
||||
lvl=lvl%256
|
||||
return
|
||||
lvl==0 and 48 or
|
||||
lvl==1 and 43 or
|
||||
lvl==2 and 38 or
|
||||
lvl==3 and 33 or
|
||||
lvl==4 and 28 or
|
||||
lvl==5 and 23 or
|
||||
lvl==6 and 18 or
|
||||
lvl==7 and 13 or
|
||||
lvl==8 and 8 or
|
||||
lvl==9 and 6 or
|
||||
lvl<13 and 5 or
|
||||
lvl<16 and 4 or
|
||||
lvl<19 and 3 or
|
||||
lvl<29 and 2 or
|
||||
1
|
||||
end
|
||||
local gc_setColor=love.graphics.setColor
|
||||
return{
|
||||
das=16,arr=6,
|
||||
sddas=2,sdarr=2,
|
||||
sddas=2,sdarr=2,
|
||||
irs=false,ims=false,
|
||||
drop=2,
|
||||
lock=2,
|
||||
wait=10,
|
||||
fall=25,
|
||||
drop=2,lock=2,
|
||||
wait=10,fall=25,
|
||||
freshLimit=0,
|
||||
fieldH=19,
|
||||
nextCount=1,holdCount=0,
|
||||
nextCount=1,
|
||||
holdCount=0,
|
||||
RS='Classic',
|
||||
sequence='rnd',
|
||||
noTele=true,
|
||||
keyCancel={5,6},
|
||||
mesDisp=function(P)
|
||||
setFont(75)
|
||||
local r=P.modeData.target/10
|
||||
mStr(r<11 and 19 or r<22 and r+9 or("%02x"):format(r*10-220),63,210)
|
||||
mStr(GetLevelStr(P.modeData.lvl),63,210)
|
||||
mText(TEXTOBJ.speedLV,63,290)
|
||||
PLY.draw.drawProgress(P.stat.row,P.modeData.target)
|
||||
if P.modeData.drought>7 then
|
||||
@@ -33,19 +56,25 @@ return{
|
||||
end
|
||||
end,
|
||||
task=function(P)
|
||||
P.modeData.lvl=19
|
||||
P.modeData.target=10
|
||||
end,
|
||||
hook_drop=function(P)
|
||||
local D=P.modeData
|
||||
D.drought=P.lastPiece.id==7 and 0 or D.drought+1
|
||||
if P.stat.row>=D.target then
|
||||
D.target=D.target+10
|
||||
if D.target==200 then
|
||||
P.gameEnv.drop,P.gameEnv.lock=1,1
|
||||
SFX.play('blip_1')
|
||||
--if D.target>=200 then
|
||||
D.lvl=D.lvl+1
|
||||
--end
|
||||
local dropSpd=GetGravity(D.lvl)
|
||||
if dropSpd~=P.gameEnv.drop then
|
||||
P.gameEnv.drop,P.gameEnv.lock=dropSpd,dropSpd
|
||||
P.gameEnv.sddas,P.gameEnv.sdarr=dropSpd,dropSpd
|
||||
SFX.play('warn_1')
|
||||
else
|
||||
SFX.play('reach')
|
||||
end
|
||||
D.target=D.target+10
|
||||
end
|
||||
end,
|
||||
}
|
||||
end
|
||||
}
|
||||
|
||||
@@ -1,3 +1,28 @@
|
||||
local function GetLevelStr(lvl)
|
||||
local list={"01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","00","0A","14","1E","28","32","3C","46","50","5A","64","6E","78","82","8C","96","A0","AA","B4","BE","C6","20","E6","20","06","21","26","21","46","21","66","21","86","21","A6","21","C6","21","E6","21","06","22","26","22","46","22","66","22","86","22","A6","22","C6","22","E6","22","06","23","26","23","85","A8","29","F0","4A","4A","4A","4A","8D","07","20","A5","A8","29","0F","8D","07","20","60","A6","49","E0","15","10","53","BD","D6","96","A8","8A","0A","AA","E8","BD","EA","96","8D","06","20","CA","A5","BE","C9","01","F0","1E","A5","B9","C9","05","F0","0C","BD","EA","96","38","E9","02","8D","06","20","4C","67","97","BD","EA","96","18","69","0C","8D","06","20","4C","67","97","BD","EA","96","18","69","06","8D","06","20","A2","0A","B1","B8","8D","07","20","C8","CA","D0","F7","E6","49","A5","49","C9","14","30","04","A9","20","85","49","60","A5","B1","29","03","D0","78","A9","00","85","AA","A6","AA","B5","4A","F0","5C","0A","A8","B9","EA","96","85","A8","A5","BE","C9","01","D0","0A","A5","A8","18","69","06","85","A8","4C","BD","97","A5","B9","C9","04","D0","0A","A5","A8","38","E9","02","85","A8","4C","BD","97","A5","A8"}
|
||||
list[0]="00"
|
||||
lvl=lvl%256
|
||||
return list[lvl]
|
||||
end
|
||||
local function GetGravity(lvl)
|
||||
lvl=lvl%256
|
||||
return
|
||||
lvl==0 and 48 or
|
||||
lvl==1 and 43 or
|
||||
lvl==2 and 38 or
|
||||
lvl==3 and 33 or
|
||||
lvl==4 and 28 or
|
||||
lvl==5 and 23 or
|
||||
lvl==6 and 18 or
|
||||
lvl==7 and 13 or
|
||||
lvl==8 and 8 or
|
||||
lvl==9 and 6 or
|
||||
lvl<13 and 5 or
|
||||
lvl<16 and 4 or
|
||||
lvl<19 and 3 or
|
||||
lvl<29 and 2 or
|
||||
1
|
||||
end
|
||||
local gc_setColor=love.graphics.setColor
|
||||
return{
|
||||
das=16,arr=6,
|
||||
@@ -15,8 +40,7 @@ return{
|
||||
keyCancel={5,6},
|
||||
mesDisp=function(P)
|
||||
setFont(75)
|
||||
local r=P.modeData.target/10
|
||||
mStr(r==1 and 29 or("%02x"):format(r*10-20),63,210)
|
||||
mStr(GetLevelStr(P.modeData.lvl),63,210)
|
||||
mText(TEXTOBJ.speedLV,63,290)
|
||||
PLY.draw.drawProgress(P.stat.row,P.modeData.target)
|
||||
if P.modeData.drought>7 then
|
||||
@@ -32,18 +56,17 @@ return{
|
||||
end
|
||||
end,
|
||||
task=function(P)
|
||||
P.modeData.lvl=29
|
||||
P.modeData.target=10
|
||||
end,
|
||||
hook_drop=function(P)
|
||||
local D=P.modeData
|
||||
D.drought=P.lastPiece.id==7 and 0 or D.drought+1
|
||||
if P.stat.row>=D.target then
|
||||
if D.target==100 then
|
||||
P:win('finish')
|
||||
return
|
||||
end
|
||||
D.target=D.target+10
|
||||
if P.stat.row>=D.target then
|
||||
if D.target>=200 then P.win('finish') return end
|
||||
SFX.play('reach')
|
||||
D.lvl=D.lvl+1
|
||||
D.target=D.target+10
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user