Compare commits
1 Commits
v0.0.19072
...
v0.0.19072
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2436a2d0bf |
14
BGblock.lua
Normal file
14
BGblock.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
local count=0
|
||||
BGblockList={}for i=1,16 do BGblockList[i]={}end
|
||||
|
||||
function getNewBlock()
|
||||
count=count+1
|
||||
if count==17 then count=1 end
|
||||
local t=BGblockList[count]
|
||||
t.bn,t.size=rnd(7),2+3*rnd()
|
||||
t.b=blocks[t.bn][rnd(0,3)]
|
||||
t.x=rnd(-#t.b[1]*t.size*30+100,1180)
|
||||
t.y=-#t.b*30*t.size
|
||||
t.v=t.size*(1+rnd())
|
||||
return t
|
||||
end
|
||||
10
TRS.lua
10
TRS.lua
@@ -8,7 +8,15 @@ blocks={
|
||||
{[0]={{1,1,1,1}},{{1},{1},{1},{1}},{{1,1,1,1}},{{1},{1},{1},{1}}},--I
|
||||
}
|
||||
do
|
||||
scs={{1,2},{1,2},{1,2},{1,2},{1,2},{1.5,1.5},{.5,2.5}}
|
||||
scs={
|
||||
{[0]={1,2},{2,1},{2,2},{2,2}},
|
||||
{[0]={1,2},{2,1},{2,2},{2,2}},
|
||||
{[0]={1,2},{2,1},{2,2},{2,2}},
|
||||
{[0]={1,2},{2,1},{2,2},{2,2}},
|
||||
{[0]={1,2},{2,1},{2,2},{2,2}},
|
||||
{[0]={1.5,1.5},{1.5,1.5},{1.5,1.5},{1.5,1.5},},
|
||||
{[0]={.5,2.5},{2.5,0.5},{1.5,2.5},{2.5,1.5}},
|
||||
}
|
||||
TRS={
|
||||
[1]={
|
||||
[01]={{0,0},{-1,0},{-1,1},{0,-2},{-1,-2},{0,1}},
|
||||
|
||||
31
ai.lua
31
ai.lua
@@ -18,6 +18,20 @@ spinOffset={
|
||||
{0,0,0},--O
|
||||
{2,0,1},--I
|
||||
}for i=1,7 do spinOffset[i][0]=0 end
|
||||
|
||||
|
||||
local count=0
|
||||
RowFree={}for i=1,16 do RowFree[i]={}end
|
||||
function getNewRow(len)
|
||||
count=count+1
|
||||
if count==17 then count=1 end
|
||||
for i=1,len do
|
||||
RowFree[count][i]=0
|
||||
end
|
||||
return RowFree[count]
|
||||
end
|
||||
--Cache manage
|
||||
|
||||
function ifoverlapAI(field,bk,x,y)
|
||||
if x<1 or x+#bk[1]>11 or y<1 then return true end
|
||||
if y>#field then return nil end
|
||||
@@ -25,20 +39,24 @@ function ifoverlapAI(field,bk,x,y)
|
||||
if field[y+i-1]and bk[i][j]>0 and field[y+i-1][x+j-1]>0 then return true end
|
||||
end end
|
||||
end
|
||||
function resetField(f0,start)
|
||||
function resetField(f0,start,ifOrigion)
|
||||
while field[start]do
|
||||
rem(field,start)
|
||||
end
|
||||
for i=start,#f0 do
|
||||
field[i]={}
|
||||
for j=1,10 do
|
||||
field[i][j]=f0[i][j]
|
||||
if ifOrigion then
|
||||
field[i]=f0[i]
|
||||
else
|
||||
field[i]={}
|
||||
for j=1,10 do
|
||||
field[i][j]=f0[i][j]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
function getScore(field,cb,cx,cy)
|
||||
local highest=0
|
||||
local height={}
|
||||
local height=getNewRow(0)
|
||||
local rough=0
|
||||
local clear=0
|
||||
local hole=0
|
||||
@@ -101,7 +119,7 @@ function AI_getControls(ctrl)
|
||||
end--move to bottom
|
||||
for i=1,#cb do
|
||||
local y=cy+i-1
|
||||
if not field[y]then field[y]={0,0,0,0,0,0,0,0,0,0}end
|
||||
if not field[y]then field[y]=getNewRow(10)end
|
||||
for j=1,#cb[1]do
|
||||
if cb[i][j]~=0 then
|
||||
field[y][cx+j-1]=1
|
||||
@@ -116,6 +134,7 @@ function AI_getControls(ctrl)
|
||||
end
|
||||
end
|
||||
end--ifHold
|
||||
resetField(field_org,cy,true)--True reset,no temp pointer
|
||||
|
||||
cb,cx,cy=cb_org,cx_org,cy_org
|
||||
if best.hold then
|
||||
|
||||
76
button.lua
76
button.lua
@@ -2,57 +2,57 @@ Buttons={
|
||||
load={},
|
||||
intro={},
|
||||
main={
|
||||
{x=240,y=300,w=320,h=60,rgb=color.red,t="Play",code=function()gotoScene("mode")end},
|
||||
{x=240,y=380,w=320,h=60,rgb=color.blue,t="Settings",code=function()gotoScene("setting")end},
|
||||
{x=155,y=460,w=150,h=60,rgb=color.yellow,t="Help",code=function()gotoScene("help")end},
|
||||
{x=325,y=460,w=150,h=60,rgb=color.cyan,t="Statistics",code=function()gotoScene("stat")end},
|
||||
{x=240,y=540,w=320,h=60,rgb=color.grey,t="Quit",code=function()gotoScene("quit")end},
|
||||
{x=250,y=300,w=330,h=60,rgb=color.red,t="Play",code=function()gotoScene("mode")end,down=2},
|
||||
{x=250,y=380,w=330,h=60,rgb=color.blue,t="Settings",code=function()gotoScene("setting")end,up=1,down=3},
|
||||
{x=165,y=460,w=160,h=60,rgb=color.yellow,t="Help",code=function()gotoScene("help")end,up=2,down=5,right=4},
|
||||
{x=335,y=460,w=160,h=60,rgb=color.cyan,t="Statistics",code=function()gotoScene("stat")end,up=2,down=5,left=3},
|
||||
{x=250,y=540,w=330,h=60,rgb=color.grey,t="Quit",code=function()gotoScene("quit")end,up=3},
|
||||
},
|
||||
mode={
|
||||
{x=330,y=140,w=280,h=70,rgb=color.white,t="40 Lines",code=function()startGame("sprint")end},
|
||||
{x=640,y=140,w=280,h=70,rgb=color.white,t="Zen",code=function()startGame("zen")end},
|
||||
{x=950,y=140,w=280,h=70,rgb=color.white,t="GM Roll",code=function()startGame("gmroll")end},
|
||||
{x=330,y=250,w=280,h=70,rgb=color.white,t="Marathon",code=function()startGame("marathon")end},
|
||||
{x=330,y=360,w=280,h=70,rgb=color.white,t="Death",code=function()startGame("death")end},
|
||||
{x=640,y=250,w=280,h=70,rgb=color.white,t="Tetris 25",code=function()startGame("tetris25")end},
|
||||
{x=640,y=360,w=280,h=70,rgb=color.white,t="AI Solo",code=function()startGame("solo")end},
|
||||
{x=950,y=250,w=280,h=70,rgb=color.white,t="Blind",code=function()startGame("blind")end},
|
||||
{x=950,y=360,w=280,h=70,rgb=color.white,t="Asymmetry Solo",code=function()startGame("asymsolo")end},
|
||||
{x=640,y=590,w=180,h=60,rgb=color.white,t="Back",code=function()gotoScene("main")end},
|
||||
{x=330,y=140,w=280,h=70,rgb=color.white,t="40 Lines",code=function()startGame("sprint")end,down=4,right=2},
|
||||
{x=640,y=140,w=280,h=70,rgb=color.white,t="Zen",code=function()startGame("zen")end,down=5,left=1,right=3},
|
||||
{x=950,y=140,w=280,h=70,rgb=color.white,t="GM Roll",code=function()startGame("gmroll")end,down=6,left=2},
|
||||
{x=330,y=250,w=280,h=70,rgb=color.white,t="Marathon",code=function()startGame("marathon")end,up=1,down=7,right=5},
|
||||
{x=640,y=250,w=280,h=70,rgb=color.white,t="Tetris 25",code=function()startGame("tetris25")end,up=2,down=8,left=4,right=6},
|
||||
{x=950,y=250,w=280,h=70,rgb=color.white,t="Blind",code=function()startGame("blind")end,up=3,down=9,left=5},
|
||||
{x=330,y=360,w=280,h=70,rgb=color.white,t="Death",code=function()startGame("death")end,up=4,down=10,right=8},
|
||||
{x=640,y=360,w=280,h=70,rgb=color.white,t="AI Solo",code=function()startGame("solo")end,up=5,down=10,right=9,left=7},
|
||||
{x=950,y=360,w=280,h=70,rgb=color.white,t="Asymmetry Solo",code=function()startGame("asymsolo")end,up=6,down=10,left=8},
|
||||
{x=640,y=590,w=180,h=60,rgb=color.white,t="Back",code=function()gotoScene("main")end,up=8},
|
||||
},
|
||||
play={
|
||||
{x=1230,y=30,w=80,h=40,rgb=color.white,t="Back",code=function()gotoScene("mode")end},
|
||||
},
|
||||
setting={
|
||||
{x=330,y=100,w=200,h=60,rgb=color.white,t=function()return setting.ghost and"Ghost ON"or"Ghost OFF"end,code=function()setting.ghost=not setting.ghost end},
|
||||
{x=540,y=100,w=200,h=60,rgb=color.white,t=function()return setting.center and"Center ON"or"Center OFF"end,code=function()setting.center=not setting.center end},
|
||||
{x=870,y=100,w=340,h=60,rgb=color.white,t=function()return setting.sfx and"Disable SFX"or"Enable SFX"end,code=function()setting.sfx=not setting.sfx end},
|
||||
{x=870,y=180,w=340,h=60,rgb=color.white,t=function()return setting.bgm and"Disable BGM"or"Enable BGM"end,code=function()BGM()setting.bgm=not setting.bgmBGM("blank")end},
|
||||
{x=330,y=100,w=200,h=60,rgb=color.white,t=function()return setting.ghost and"Ghost ON"or"Ghost OFF"end,code=function()setting.ghost=not setting.ghost end,down=6,right=2},
|
||||
{x=540,y=100,w=200,h=60,rgb=color.white,t=function()return setting.center and"Center ON"or"Center OFF"end,code=function()setting.center=not setting.center end,down=6,left=1,right=3},
|
||||
{x=870,y=100,w=340,h=60,rgb=color.white,t=function()return setting.sfx and"Disable SFX"or"Enable SFX"end,code=function()setting.sfx=not setting.sfx end,down=4,left=2},
|
||||
{x=870,y=180,w=340,h=60,rgb=color.white,t=function()return setting.bgm and"Disable BGM"or"Enable BGM"end,code=function()BGM()setting.bgm=not setting.bgm;BGM("blank")end,up=3,down=5,left=2},
|
||||
{x=870,y=260,w=340,h=60,rgb=color.white,t=function()return setting.fullscreen and"Disable fullscreen"or"Enable fullscreen"end,
|
||||
code=function()
|
||||
setting.fullscreen=not setting.fullscreen
|
||||
love.window.setFullscreen(setting.fullscreen)
|
||||
end
|
||||
end,
|
||||
up=4,down=7,left=6
|
||||
},
|
||||
{x=390,y=250,w=320,h=60,rgb=color.white,t="Advanced settings",code=function()gotoScene("setting2")end},
|
||||
{x=640,y=590,w=180,h=60,rgb=color.white,t="Back",code=function()back()end},
|
||||
{x=435,y=250,w=320,h=60,rgb=color.white,t="Advanced settings",code=function()gotoScene("setting2")end,up=1,down=7,right=5},
|
||||
{x=640,y=590,w=180,h=60,rgb=color.white,t="Back",code=function()back()end,up=6},
|
||||
},
|
||||
setting2={
|
||||
{x=850,y=90,w=40,h=40,rgb=color.white,t="-",code=function()setting.das=(setting.das-1)%31 end,hold=true},
|
||||
{x=1210,y=90,w=40,h=40,rgb=color.white,t="+",code=function()setting.das=(setting.das+1)%31 end,hold=true},
|
||||
{x=1260,y=90,w=40,h=40,rgb=color.white,t="-",code=function()setting.arr=(setting.arr-1)%16 end,hold=true},
|
||||
{x=1430,y=90,w=40,h=40,rgb=color.white,t="+",code=function()setting.arr=(setting.arr+1)%16 end,hold=true},
|
||||
{x=420,y=70,w=190,h=45,rgb=color.white,t=function()return setting.key[1]end,code=function()keysetting=1 end},
|
||||
{x=420,y=130,w=190,h=45,rgb=color.white,t=function()return setting.key[2]end,code=function()keysetting=2 end},
|
||||
{x=420,y=190,w=190,h=45,rgb=color.white,t=function()return setting.key[3]end,code=function()keysetting=3 end},
|
||||
{x=420,y=250,w=190,h=45,rgb=color.white,t=function()return setting.key[4]end,code=function()keysetting=4 end},
|
||||
{x=420,y=310,w=190,h=45,rgb=color.white,t=function()return setting.key[5]end,code=function()keysetting=5 end},
|
||||
{x=420,y=370,w=190,h=45,rgb=color.white,t=function()return setting.key[6]end,code=function()keysetting=6 end},
|
||||
{x=420,y=430,w=190,h=45,rgb=color.white,t=function()return setting.key[7]end,code=function()keysetting=7 end},
|
||||
{x=420,y=490,w=190,h=45,rgb=color.white,t=function()return setting.key[8]end,code=function()keysetting=8 end},
|
||||
{x=420,y=550,w=190,h=45,rgb=color.white,t=function()return setting.key[9]end,code=function()keysetting=9 end},
|
||||
{x=420,y=630,w=120,h=55,rgb=color.white,t="Reset",code=function()setting.key={"left","right","x","z","c","up","down","space","r","LEFT","RIGHT"}end},
|
||||
{x=640,y=590,w=180,h=60,rgb=color.white,t="Back",code=function()keysetting=nil;back()end},
|
||||
{x=420,y=70,w=190,h=45,rgb=color.white,t=function()return setting.key[1]end,code=function()keysetting=1 end,down=2,right=10},
|
||||
{x=420,y=130,w=190,h=45,rgb=color.white,t=function()return setting.key[2]end,code=function()keysetting=2 end,up=1,down=3,right=10},
|
||||
{x=420,y=190,w=190,h=45,rgb=color.white,t=function()return setting.key[3]end,code=function()keysetting=3 end,up=2,down=4,right=10},
|
||||
{x=420,y=250,w=190,h=45,rgb=color.white,t=function()return setting.key[4]end,code=function()keysetting=4 end,up=3,down=5,right=10},
|
||||
{x=420,y=310,w=190,h=45,rgb=color.white,t=function()return setting.key[5]end,code=function()keysetting=5 end,up=4,down=6,right=10},
|
||||
{x=420,y=370,w=190,h=45,rgb=color.white,t=function()return setting.key[6]end,code=function()keysetting=6 end,up=5,down=7,right=10},
|
||||
{x=420,y=430,w=190,h=45,rgb=color.white,t=function()return setting.key[7]end,code=function()keysetting=7 end,up=6,down=8,right=10},
|
||||
{x=420,y=490,w=190,h=45,rgb=color.white,t=function()return setting.key[8]end,code=function()keysetting=8 end,up=7,down=9,right=10},
|
||||
{x=420,y=550,w=190,h=45,rgb=color.white,t=function()return setting.key[9]end,code=function()keysetting=9 end,up=8,down=14,right=15},
|
||||
{x=745,y=90,w=40,h=40,rgb=color.white,t="-",code=function()setting.das=(setting.das-1)%31 end,hold=true,left=1,right=11,down=15},
|
||||
{x=910,y=90,w=40,h=40,rgb=color.white,t="+",code=function()setting.das=(setting.das+1)%31 end,hold=true,left=10,right=12,down=15},
|
||||
{x=960,y=90,w=40,h=40,rgb=color.white,t="-",code=function()setting.arr=(setting.arr-1)%16 end,hold=true,left=11,right=13,down=15},
|
||||
{x=1125,y=90,w=40,h=40,rgb=color.white,t="+",code=function()setting.arr=(setting.arr+1)%16 end,hold=true,left=12,down=15},
|
||||
{x=420,y=630,w=120,h=55,rgb=color.white,t="Reset",code=function()for i=1,#setting.key do setting.key[i]=gameEnv0.key[i] end end,up=9,right=15},
|
||||
{x=640,y=590,w=180,h=60,rgb=color.white,t="Back",code=function()keysetting=nil;back()end,left=9,up=9},
|
||||
},
|
||||
help={
|
||||
{x=640,y=590,w=180,h=60,rgb=color.white,t="Back",code=function()back()end},
|
||||
|
||||
40
control.lua
40
control.lua
@@ -5,7 +5,7 @@ function love.mousemoved(x,y)
|
||||
local B=Buttons[scene][i]
|
||||
if not(B.hide and B.hide())then
|
||||
if abs(mx-B.x)<B.w*.5 and abs(my-B.y)<B.h*.5 then
|
||||
Buttons.sel=B
|
||||
Buttons.sel=i
|
||||
return nil
|
||||
end
|
||||
end
|
||||
@@ -17,7 +17,7 @@ function love.mousepressed(x,y,k)
|
||||
if mouseDown[scene]then mouseDown[scene](mx,my,k)end
|
||||
if k==1 then
|
||||
if not sceneSwaping and Buttons.sel then
|
||||
local B=Buttons.sel
|
||||
local B=Buttons[scene][Buttons.sel]
|
||||
if B.hold then Buttons.pressing=max(Buttons.pressing,1)end
|
||||
B.code()
|
||||
B.alpha=1
|
||||
@@ -45,27 +45,25 @@ function love.touchmoved(id,x,y,dx,dy)
|
||||
end
|
||||
|
||||
function love.keypressed(i)
|
||||
--[[
|
||||
if Buttons.sel then
|
||||
local b=Buttons.sel
|
||||
if i=="up"then b.y=b.y-10
|
||||
elseif i=="down"then b.y=b.y+10
|
||||
elseif i=="left"then b.x=b.x-10
|
||||
elseif i=="right"then b.x=b.x+10
|
||||
elseif i=="k"then b.w=b.w-10
|
||||
elseif i=="l"then b.w=b.w+10
|
||||
elseif i==","then b.h=b.h-10
|
||||
elseif i=="."then b.h=b.h+10
|
||||
elseif i=="s"then
|
||||
print("")
|
||||
for i=1,#Buttons[scene]do
|
||||
local b=Buttons[scene][i]
|
||||
print(b.t,b.x,b.y,b.w,b.h)
|
||||
if scene~="play"or scene=="setting2"and not keysetting then
|
||||
if i=="up"or i=="down"or i=="left"or i=="right"then
|
||||
if not Buttons.sel then
|
||||
Buttons.sel=1
|
||||
else
|
||||
Buttons.sel=Buttons[scene][Buttons.sel][i]or Buttons.sel
|
||||
end
|
||||
elseif i=="space"or i=="return"then
|
||||
if not sceneSwaping and Buttons.sel then
|
||||
local B=Buttons[scene][Buttons.sel]
|
||||
if B.hold then Buttons.pressing=max(Buttons.pressing,1)end
|
||||
B.code()
|
||||
B.alpha=1
|
||||
SFX("button")
|
||||
end
|
||||
end
|
||||
end]]
|
||||
if keyDown[scene]then keyDown[scene](i)
|
||||
elseif i=="escape"then back()
|
||||
end
|
||||
if keyDown[scene]then return keyDown[scene](i)
|
||||
elseif i=="escape"then return back()
|
||||
end
|
||||
end
|
||||
function love.keyreleased(i)
|
||||
|
||||
@@ -28,7 +28,6 @@ function game.play()
|
||||
scene="play"
|
||||
--curBG="game1"
|
||||
resetGameData()
|
||||
collectgarbage()
|
||||
SFX("ready")
|
||||
end
|
||||
function game.setting()
|
||||
|
||||
BIN
image/attack_1.png
Normal file
BIN
image/attack_1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 404 B |
BIN
image/attack_2.png
Normal file
BIN
image/attack_2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 882 B |
BIN
image/attack_3.png
Normal file
BIN
image/attack_3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 973 B |
BIN
image/block.png
BIN
image/block.png
Binary file not shown.
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.7 KiB |
199
main.lua
199
main.lua
@@ -50,6 +50,10 @@ Texts={
|
||||
"Total block used:",
|
||||
"Total rows cleared:",
|
||||
"Total lines sent:",
|
||||
"Total key pressed:",
|
||||
"Total rotate:",
|
||||
"Total hold:",
|
||||
"Total spin:",
|
||||
},
|
||||
help={
|
||||
"I think you don't need \"help\".",
|
||||
@@ -193,6 +197,22 @@ color={
|
||||
white={1,1,1},
|
||||
grey={.6,.6,.6},
|
||||
}
|
||||
attackColor={
|
||||
{color.red,color.yellow},
|
||||
{color.red,color.cyan},
|
||||
{color.blue,color.white},
|
||||
animate={
|
||||
function(t)
|
||||
gc.setColor(1,t,0)
|
||||
end,
|
||||
function(t)
|
||||
gc.setColor(1-t,t,t)
|
||||
end,
|
||||
function(t)
|
||||
gc.setColor(t,t,1)
|
||||
end,
|
||||
}
|
||||
}
|
||||
-- for k,v in pairs(color) do
|
||||
-- v[1],v[2],v[3]=255*v[1],255*v[2],255*v[3]
|
||||
-- end
|
||||
@@ -203,9 +223,12 @@ clearName={"Single","Double","Triple"}
|
||||
actName={"moveLeft","moveRight","rotRight","rotLeft","rotFlip","hardDrop","softDrop","hold","restart","toLeft","toRight"}
|
||||
actName_show={"move left","move right","rotate right","rotate left","rotate flip","hard drop","soft drop","hold","restart","toLeft","toRight"}
|
||||
blockPos={4,4,4,4,4,5,4}
|
||||
renATK={[0]=0,0,0,1,1,1,2,2,2,3,3,3}--4 else
|
||||
renATK={[0]=0,0,0,1,1,2,2,3,3,3}--4 else
|
||||
b2bATK={3,5,8}
|
||||
require("TRS")--load block&TRS kick
|
||||
|
||||
marathon_drop={[0]=60,48,40,30,24,18,15,12,10,8,7,6,5,4,3,2,1,1,0,0}
|
||||
|
||||
gameEnv0={
|
||||
das=6,arr=1,
|
||||
ghost=true,center=true,
|
||||
@@ -415,7 +438,7 @@ Event={
|
||||
if s>=20 then
|
||||
Event.gameover.win()
|
||||
else
|
||||
gameEnv.drop=Data.marathon_drop[s]
|
||||
gameEnv.drop=marathon_drop[s]
|
||||
if s==18 then gameEnv._20G=true end
|
||||
gameEnv.target=s*10+10
|
||||
end
|
||||
@@ -466,71 +489,63 @@ Event={
|
||||
gameover=gameover+1
|
||||
if gameover%3==0 then
|
||||
local j=gameover/3
|
||||
if j<=#field then
|
||||
if field[j]then
|
||||
for i=1,10 do
|
||||
if field[j][i]>0 then field[j][i]=13 end
|
||||
end
|
||||
else
|
||||
return true
|
||||
end
|
||||
end
|
||||
if gameover>80 then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
Data={
|
||||
marathon_drop={[0]=60,48,40,30,24,18,15,12,10,8,7,6,5,4,3,2,1,1,0,0},
|
||||
shirase_drop={[0]=0},
|
||||
shirase_lock={[0]=0},
|
||||
shirase_are={[0]=0},
|
||||
shirase_lare={[0]=0},
|
||||
}
|
||||
mesDisp={
|
||||
--Default:font=40,white
|
||||
sprint=function()
|
||||
setFont(75)
|
||||
mStr(max(40-P.cstat.row,0),-76,280)
|
||||
mStr(max(40-P.cstat.row,0),-75,280)
|
||||
end,
|
||||
zen=function()
|
||||
setFont(75)
|
||||
mStr(max(200-P.cstat.row,0),-76,280)
|
||||
mStr(max(200-P.cstat.row,0),-75,280)
|
||||
end,
|
||||
gmroll=function()
|
||||
setFont(35)
|
||||
gc.print("Tetris",-120,390)
|
||||
setFont(80)
|
||||
mStr(cstat.tetris,-77,420)
|
||||
mStr(cstat.tetris,-75,420)
|
||||
end,
|
||||
marathon=function()
|
||||
mStr(P.cstat.row.."/"..gameEnv.target,-76,250)
|
||||
mStr(P.cstat.row.."/"..gameEnv.target,-75,250)
|
||||
end,
|
||||
death=function()
|
||||
mStr(P.cstat.row.."/"..gameEnv.target,-76,250)
|
||||
mStr(P.cstat.row.."/"..gameEnv.target,-75,250)
|
||||
end,
|
||||
tetris25=function()
|
||||
gc.print("Remain",-142,510)
|
||||
gc.print("Attack",-132,365)
|
||||
gc.print("Remain",-140,450)
|
||||
gc.print("Attack",-130,305)
|
||||
setFont(80)
|
||||
mStr(#players.alive,-77,440)
|
||||
mStr(cstat.atk,-77,300)
|
||||
mStr(#players.alive,-75,380)
|
||||
mStr(cstat.atk,-75,240)
|
||||
end,
|
||||
blind=function()
|
||||
setFont(35)
|
||||
gc.print("Rows",-115,220)
|
||||
gc.print("Tetris",-120,390)
|
||||
setFont(80)
|
||||
mStr(P.cstat.row,-77,250)
|
||||
mStr(cstat.tetris,-77,420)
|
||||
mStr(P.cstat.row,-75,250)
|
||||
mStr(cstat.tetris,-75,420)
|
||||
end,
|
||||
solo=function()
|
||||
gc.print("Attack",-132,365)
|
||||
gc.print("Attack",-130,365)
|
||||
setFont(80)
|
||||
mStr(cstat.atk,-77,300)
|
||||
mStr(cstat.atk,-75,300)
|
||||
end,
|
||||
asymsolo=function()
|
||||
gc.print("Attack",-132,365)
|
||||
setFont(80)
|
||||
mStr(cstat.atk,-77,300)
|
||||
mStr(cstat.atk,-75,300)
|
||||
end,
|
||||
}
|
||||
--Game system Data
|
||||
@@ -621,6 +636,7 @@ function gotoScene(s,style)
|
||||
time=swap[style][1],mid=swap[style][2],
|
||||
draw=swap[style].d
|
||||
}
|
||||
Buttons.sel=nil
|
||||
end
|
||||
end
|
||||
function resetGameData()
|
||||
@@ -636,6 +652,7 @@ function resetGameData()
|
||||
PTC.dust[i]:start()
|
||||
end
|
||||
stat.game=stat.game+1
|
||||
collectgarbage()
|
||||
end
|
||||
function startGame(mode)
|
||||
--rec=""
|
||||
@@ -679,7 +696,7 @@ function loaddata()
|
||||
setting[t]=v
|
||||
elseif t=="ghost"or t=="center"then
|
||||
setting[t]=v=="true"
|
||||
elseif t=="run"or t=="game"or t=="gametime"or t=="piece"or t=="row"or t=="atk"or t=="key"then
|
||||
elseif t=="run"or t=="game"or t=="gametime"or t=="piece"or t=="row"or t=="atk"or t=="key"or t=="rotate"or t=="hold"or t=="spin"then
|
||||
v=toN(v)if not v or v<0 then v=0 end
|
||||
stat[t]=v
|
||||
--Statistics
|
||||
@@ -701,6 +718,9 @@ function savedata()
|
||||
t=t..stringPack("row=",stat.row)
|
||||
t=t..stringPack("atk=",stat.atk)
|
||||
t=t..stringPack("key=",stat.key)
|
||||
t=t..stringPack("rotate=",stat.rotate)
|
||||
t=t..stringPack("hold=",stat.hold)
|
||||
t=t..stringPack("spin=",stat.spin)
|
||||
t=t..stringPack("das=",setting.das)
|
||||
t=t..stringPack("arr=",setting.arr)
|
||||
t=t..stringPack("keyset=",string.concat(setting.key))
|
||||
@@ -773,7 +793,8 @@ function createPlayer(id,x,y,size,AIspeed,data)
|
||||
P.fieldBeneath=0
|
||||
|
||||
P.combo=0
|
||||
P.b2b=false
|
||||
P.b2b=0
|
||||
P.b2b1=0
|
||||
|
||||
P.task={}
|
||||
P.bonus={}
|
||||
@@ -781,9 +802,16 @@ end
|
||||
function showText(text,type,font,dy)
|
||||
ins(P.bonus,{t=0,text=text,draw=FX[type],font=font,dy=dy or 0})
|
||||
end
|
||||
function createBeam(s,r)--Player id
|
||||
function createBeam(s,r,level)--Player id
|
||||
s,r=players[s],players[r]
|
||||
ins(FX.beam,{s.x+308*s.size,s.y+680*s.size,r.x+308*r.size,r.y+680*r.size,t=0})
|
||||
ins(FX.beam,{
|
||||
s.x+(30*(cx+sc[2]-1)-30+15+150)*s.size,
|
||||
s.y+(600-30*(cy+sc[1]-1)+15+70)*s.size,
|
||||
r.x+308*r.size,
|
||||
r.y+450*r.size,
|
||||
t=0,
|
||||
lv=level,
|
||||
})
|
||||
end
|
||||
function freshgho()
|
||||
if not P.gameEnv._20G then
|
||||
@@ -822,8 +850,8 @@ function checkrow(s,num)--(cy,r)
|
||||
ins(clearing,1,i)
|
||||
P.falling=gameEnv.fall
|
||||
c=c+1--row cleared+1
|
||||
for k=1,1000 do
|
||||
PTC.dust[P.id]:setPosition(rnd(0,300),600-30*i+rnd(30))
|
||||
for k=1,250 do
|
||||
PTC.dust[P.id]:setPosition(rnd(300),600-30*i+rnd(30))
|
||||
PTC.dust[P.id]:emit(1)
|
||||
end
|
||||
end end
|
||||
@@ -838,7 +866,7 @@ function resetblock()
|
||||
P.holded=false
|
||||
P.spinLast=false
|
||||
P.freshNext()
|
||||
P.sc={scs[bn][1],scs[bn][2]}P.dir=0
|
||||
P.sc,P.dir=scs[bn][0],0
|
||||
P.r,P.c=#cb,#cb[1]
|
||||
P.cx,P.cy=blockPos[bn],21+ceil(fieldBeneath/30)
|
||||
P.dropDelay,P.lockDelay,P.freshTime=gameEnv.drop,gameEnv.lock,0
|
||||
@@ -846,7 +874,7 @@ function resetblock()
|
||||
if keyPressing[3]then spin(1,true)end
|
||||
if keyPressing[4]then spin(-1,true)end
|
||||
if keyPressing[5]then spin(2,true)end
|
||||
if ifoverlap(cb,cx,cy)then Event.gameover.lose()end
|
||||
if ifoverlap(cb,cx,cy)then lock()Event.gameover.lose()end
|
||||
freshgho()
|
||||
if keyPressing[6]then act.hardDrop()P.keyPressing[6]=false end
|
||||
end
|
||||
@@ -865,8 +893,11 @@ function pressKey(i,player)
|
||||
elseif i==2 then
|
||||
P.moving=1
|
||||
end
|
||||
P.cstat.key=P.cstat.key+1;ins(keyTime,1,frame)rem(keyTime,11)
|
||||
stat.key=stat.key+1
|
||||
|
||||
ins(keyTime,1,frame)rem(keyTime,11)
|
||||
cstat.key=cstat.key+1
|
||||
if not player then stat.key=stat.key+1 end
|
||||
--Key count
|
||||
end
|
||||
-- if playmode=="recording"then ins(rec,{i,frame})end
|
||||
end
|
||||
@@ -909,12 +940,12 @@ function hold(ifpre)
|
||||
P.hb,P.cb=blocks[hn][0],hb
|
||||
|
||||
if bn==0 then freshNext()end
|
||||
P.sc={scs[bn][1],scs[bn][2]}P.dir=0
|
||||
P.sc,P.dir=scs[bn][0],0
|
||||
P.r,P.c=#cb,#cb[1]
|
||||
P.cx,P.cy=blockPos[bn],21+ceil(fieldBeneath/30)
|
||||
freshgho()
|
||||
P.dropDelay,P.lockDelay,P.freshTime=gameEnv.drop,gameEnv.lock,0
|
||||
if ifoverlap(cb,cx,cy) then Event.gameover.lose()end
|
||||
if ifoverlap(cb,cx,cy) then lock()Event.gameover.lose()end
|
||||
P.holded=true
|
||||
SFX(ifpre and"prehold"or"hold")
|
||||
stat.hold=stat.hold+1
|
||||
@@ -944,35 +975,46 @@ function drop()
|
||||
|
||||
P.combo=P.combo+1--combo=0 is under
|
||||
if cc==4 then
|
||||
if b2b then
|
||||
if b2b>480 then
|
||||
showText("Tetris B2B2B","fly",70)
|
||||
csend=7
|
||||
elseif b2b>=100 then
|
||||
showText("Tetris B2B","drive",70)
|
||||
csend=5
|
||||
else
|
||||
showText("Tetris","stretch",80)
|
||||
csend=4
|
||||
P.b2b=true
|
||||
end
|
||||
P.b2b=P.b2b+100
|
||||
sendTime=120
|
||||
P.cstat.tetris=P.cstat.tetris+1
|
||||
elseif cc>0 then
|
||||
if dospin then
|
||||
local t=blockName[bn].." spin "..clearName[cc]
|
||||
if b2b then
|
||||
if b2b>480 then
|
||||
t=t.." B2B2B"
|
||||
showText(t,"spin",40)
|
||||
csend=b2bATK[cc]+1
|
||||
elseif b2b>=100 then
|
||||
t=t.." B2B"
|
||||
showText(t,"spin",40)
|
||||
csend=b2bATK[cc]
|
||||
sendTime=csend*40
|
||||
else
|
||||
showText(t,"spin",50)
|
||||
csend=2*cc
|
||||
sendTime=csend*30
|
||||
P.b2b=true
|
||||
end
|
||||
if mini then showText("Mini","drive",40,10)sendTime=sendTime+30 end
|
||||
sendTime=csend*35
|
||||
if mini then
|
||||
showText("Mini","drive",40,10)
|
||||
sendTime=sendTime+60
|
||||
P.b2b=P.b2b+90+10*cc
|
||||
else
|
||||
P.b2b=P.b2b+80+20*cc
|
||||
end
|
||||
SFX("spin_"..cc)
|
||||
stat.spin=stat.spin+1
|
||||
else
|
||||
P.b2b=false
|
||||
elseif #clearing<#field then
|
||||
P.b2b=P.b2b-400
|
||||
showText(clearName[cc],"appear",50)
|
||||
csend=cc-1
|
||||
sendTime=20+csend*20
|
||||
@@ -982,13 +1024,16 @@ function drop()
|
||||
if dospin then
|
||||
showText(blockName[bn].." spin","appear",50)
|
||||
SFX("spin_0")
|
||||
P.b2b=b2b+30
|
||||
end
|
||||
end
|
||||
|
||||
if cc>0 and #clearing==#field then
|
||||
showText("Perfect Clear","flicker",70,-60)
|
||||
showText("Perfect Clear","flicker",70)
|
||||
csend=csend+6
|
||||
sendTime=sendTime+90
|
||||
sendTime=sendTime+30
|
||||
SFX("perfectclear")
|
||||
P.b2b=b2b+100
|
||||
end
|
||||
csend=csend+(renATK[combo]or 4)
|
||||
sendTime=sendTime+20*combo
|
||||
@@ -996,6 +1041,13 @@ function drop()
|
||||
SFX("clear_"..cc)
|
||||
SFX("ren_"..min(combo,11))
|
||||
end
|
||||
|
||||
if b2b<0 then
|
||||
P.b2b=0
|
||||
elseif b2b>600 then
|
||||
P.b2b=600
|
||||
end
|
||||
|
||||
if csend>0 then
|
||||
if mini then csend=int(csend*.7)end
|
||||
--mini attack decrease
|
||||
@@ -1040,11 +1092,12 @@ function lock()
|
||||
end
|
||||
function garbageSend(sender,send,time)
|
||||
local pos,r=rnd(10)
|
||||
local level=send<4 and 1 or send<7 and 2 or 3
|
||||
repeat
|
||||
r=players.alive[rnd(#players.alive)]
|
||||
until r~=P.id
|
||||
createBeam(sender,r)
|
||||
ins(players[r].atkBuffer,{pos,amount=send,countdown=time,cd0=time,time=0,sent=false})
|
||||
createBeam(sender,r,level)
|
||||
ins(players[r].atkBuffer,{pos,amount=send,countdown=time,cd0=time,time=0,sent=false,lv=level})
|
||||
sort(players[r].atkBuffer,sortByTime)
|
||||
end
|
||||
function garbageRelease()
|
||||
@@ -1102,6 +1155,7 @@ function keyUp.play(key)
|
||||
end
|
||||
wheelmoved={}
|
||||
|
||||
require("BGblock")--BG block module
|
||||
require("ai")--AI module
|
||||
require("timer")--Timer
|
||||
require("paint")--Paint
|
||||
@@ -1114,20 +1168,16 @@ function love.update(dt)
|
||||
for k,v in pairs(players[1])do
|
||||
if rawget(_G,k)then print(k)end
|
||||
end
|
||||
end--variables flew debugging]]
|
||||
end--check player data flew(debugging)
|
||||
]]
|
||||
for i=#BGblock,1,-1 do
|
||||
BGblock[i].y=BGblock[i].y+BGblock[i].v
|
||||
if BGblock[i].y>720 then rem(BGblock[i])end
|
||||
if BGblock[i].y>720 then rem(BGblock,i)end
|
||||
end
|
||||
BGblock.ct=BGblock.ct-1
|
||||
if BGblock.ct==0 then
|
||||
local t={bn=rnd(7),size=2+3*rnd()}
|
||||
t.b=blocks[t.bn][rnd(0,3)]
|
||||
t.x=rnd(-#t.b[1]*t.size*30+100,1180)
|
||||
t.y=-#t.b*30*t.size
|
||||
t.v=t.size*(1+rnd())
|
||||
ins(BGblock,t)
|
||||
BGblock.ct=rnd(20,40)
|
||||
ins(BGblock,getNewBlock())
|
||||
BGblock.ct=rnd(20,30)
|
||||
end
|
||||
--Background blocks update
|
||||
|
||||
@@ -1202,6 +1252,7 @@ function love.draw()
|
||||
|
||||
numFont(20)gc.setColor(1,1,1)
|
||||
gc.print(tm.getFPS(),0,700)
|
||||
gc.print(gcinfo(),0,670)
|
||||
--if gcinfo()>500 then collectgarbage()end
|
||||
end
|
||||
function love.resize(x,y)
|
||||
@@ -1282,12 +1333,34 @@ do--Particle
|
||||
PTC={dust={}}--Particle systems
|
||||
c=gc.newCanvas(6,6)gc.setCanvas(c)
|
||||
gc.clear(1,1,1)
|
||||
PTC.dust[0]=gc.newParticleSystem(c,10000)
|
||||
PTC.dust[0]=gc.newParticleSystem(c,1000)
|
||||
PTC.dust[0]:setParticleLifetime(.2,.3)
|
||||
PTC.dust[0]:setEmissionRate(0)
|
||||
PTC.dust[0]:setLinearAcceleration(-1500,-200,1500,200)
|
||||
PTC.dust[0]:setColors(1,1,1,.4,1,1,1,0)
|
||||
PTC.dust[0]:setColors(1,1,1,.5,1,1,1,0)
|
||||
c:release()
|
||||
--Dust particles
|
||||
|
||||
PTC.attack={}
|
||||
PTC.attack[1]=gc.newParticleSystem(gc.newImage("/image/attack_1.png"),200)
|
||||
PTC.attack[1]:setParticleLifetime(.25)
|
||||
PTC.attack[1]:setEmissionRate(0)
|
||||
PTC.attack[1]:setSpin(10)
|
||||
PTC.attack[1]:setColors(1,1,1,.7,1,1,1,0)
|
||||
|
||||
PTC.attack[2]=gc.newParticleSystem(gc.newImage("/image/attack_2.png"),200)
|
||||
PTC.attack[2]:setParticleLifetime(.3)
|
||||
PTC.attack[2]:setEmissionRate(0)
|
||||
PTC.attack[2]:setSpin(8)
|
||||
PTC.attack[2]:setColors(1,1,1,.7,1,1,1,0)
|
||||
|
||||
PTC.attack[3]=gc.newParticleSystem(gc.newImage("/image/attack_3.png"),200)
|
||||
PTC.attack[3]:setParticleLifetime(.4)
|
||||
PTC.attack[3]:setEmissionRate(0)
|
||||
PTC.attack[3]:setSpin(6)
|
||||
PTC.attack[3]:setColors(1,1,1,.7,1,1,1,0)
|
||||
--Attack particles
|
||||
|
||||
gc.setCanvas()
|
||||
end
|
||||
c=nil
|
||||
|
||||
82
paint.lua
82
paint.lua
@@ -37,7 +37,7 @@ function drawButton()
|
||||
for i=1,#Buttons[scene]do
|
||||
local B=Buttons[scene][i]
|
||||
if not(B.hide and B.hide())then
|
||||
local t=B==Buttons.sel and .3 or 0
|
||||
local t=i==Buttons.sel and .3 or 0
|
||||
B.alpha=abs(B.alpha-t)>.02 and(B.alpha+(B.alpha<t and .02 or -.02))or t
|
||||
if B.alpha>t then B.alpha=B.alpha-.02 elseif B.alpha<t then B.alpha=B.alpha+.02 end
|
||||
gc.setColor(B.rgb[1],B.rgb[2],B.rgb[3],B.alpha)
|
||||
@@ -88,28 +88,28 @@ function Pnt.BG.game1()
|
||||
end
|
||||
function Pnt.BG.game2()
|
||||
gc.setColor(1,.5,.5)
|
||||
gc.draw(background[1],640,360,Timer()*.15,nil,nil,768,768)
|
||||
gc.draw(background[1],640,360,Timer()*.2,nil,nil,768,768)
|
||||
end
|
||||
function Pnt.BG.game3()
|
||||
gc.setColor(.6,.6,1)
|
||||
gc.draw(background[1],640,360,Timer()*.15,nil,nil,768,768)
|
||||
gc.draw(background[1],640,360,Timer()*.25,nil,nil,768,768)
|
||||
end
|
||||
|
||||
function Pnt.load()
|
||||
if loadprogress then
|
||||
gc.setLineWidth(4)
|
||||
gc.setColor(.8,.8,.8)
|
||||
gc.rectangle("fill",340,340,loadprogress*640,40)
|
||||
gc.setColor(1,1,1)
|
||||
gc.rectangle("line",340,340,640,40)
|
||||
setFont(30)
|
||||
mStr("Loading...",640,345)
|
||||
end
|
||||
gc.setLineWidth(4)
|
||||
gc.setColor(1,1,1,.5)
|
||||
gc.rectangle("fill",340,340,loadprogress*640,40)
|
||||
gc.setColor(1,1,1)
|
||||
gc.rectangle("line",340,340,640,40)
|
||||
setFont(30)
|
||||
mStr(Text.load[loading],640,345)
|
||||
setFont(20)
|
||||
mStr("not animation,real loading!",640,392)
|
||||
end
|
||||
function Pnt.main()
|
||||
gc.setColor(1,1,1)
|
||||
setFont(30)
|
||||
gc.print("Alpha 0.0.19726",370,150)
|
||||
gc.print("Alpha 0.1.19727",370,150)
|
||||
gc.draw(img.title[setting.lang],30,30)
|
||||
end
|
||||
function Pnt.play()
|
||||
@@ -167,7 +167,7 @@ function Pnt.play()
|
||||
gc.draw(PTC.dust[p])--Draw game field
|
||||
love.graphics.setStencilTest()--In-playField mask
|
||||
gc.translate(0,-fieldBeneath)
|
||||
gc.setColor(1,1,1)gc.rectangle("line",-1,-1,300,600)--Draw boarder
|
||||
gc.setColor(1,1,1)gc.rectangle("line",-2,-12,304,614)--Draw boarder
|
||||
|
||||
local h=0
|
||||
for i=1,#atkBuffer do
|
||||
@@ -179,26 +179,34 @@ function Pnt.play()
|
||||
--Appear
|
||||
end
|
||||
if a.countdown>0 then
|
||||
gc.setColor(1,0,0)
|
||||
gc.rectangle("fill",302,600-h,8,-bar+5)
|
||||
gc.setColor(1,1,0)
|
||||
gc.rectangle("fill",302,600-h+(-bar+5),8,-(-bar+5)*(1-a.countdown/a.cd0))
|
||||
gc.setColor(attackColor[a.lv][1])
|
||||
gc.rectangle("fill",305,600-h,8,-bar+5)
|
||||
gc.setColor(attackColor[a.lv][2])
|
||||
gc.rectangle("fill",305,600-h+(-bar+5),8,-(-bar+5)*(1-a.countdown/a.cd0))
|
||||
--Timing
|
||||
else
|
||||
gc.setColor(1,(sin((Timer()-i)*20)+1)*.5,0)
|
||||
gc.rectangle("fill",302,600-h,8,-bar+5)
|
||||
attackColor.animate[a.lv]((sin((Timer()-i)*20)+1)*.5)
|
||||
gc.rectangle("fill",305,600-h,8,-bar+5)
|
||||
--Warning
|
||||
end
|
||||
else
|
||||
gc.setColor(1,0,0)
|
||||
gc.setColor(attackColor[a.lv][1])
|
||||
bar=bar*(20-a.time)*.05
|
||||
gc.rectangle("fill",302,600-h,8,-bar+5)
|
||||
gc.rectangle("fill",305,600-h,8,-bar+5)
|
||||
--Disappear
|
||||
end
|
||||
h=h+bar
|
||||
if h>600 then break end
|
||||
end--Buffer line
|
||||
|
||||
gc.setColor(1,1,1)
|
||||
gc.rectangle("fill",-15,600,10,-b2b1)
|
||||
gc.setColor(1,.4,.4)
|
||||
gc.rectangle("line",-20,600-100,15,2)
|
||||
gc.setColor(.4,.4,1)
|
||||
gc.rectangle("line",-20,600-480,15,2)
|
||||
--B2B bar
|
||||
|
||||
setFont(40)
|
||||
if gameEnv.hold then
|
||||
gc.setColor(1,1,1)
|
||||
@@ -251,30 +259,17 @@ function Pnt.play()
|
||||
--Speed dials
|
||||
gc.pop()
|
||||
end--Draw players
|
||||
gc.setLineWidth(3)
|
||||
for i=1,#FX.beam do
|
||||
local b=FX.beam[i]
|
||||
local t=b.t/30
|
||||
if t<.25 then
|
||||
t=t*4
|
||||
gc.setColor(1,1,1,4*t)
|
||||
gc.line(b[1],b[2],b[1]+t*(b[3]-b[1]),b[2]+t*(b[4]-b[2]))
|
||||
elseif t<.75 then
|
||||
gc.setColor(1,1,1)
|
||||
gc.line(b[1],b[2],b[3],b[4])
|
||||
else
|
||||
t=4*t-3
|
||||
gc.setColor(1,1,1,4-4*t)
|
||||
gc.line(b[1]+t*(b[3]-b[1]),b[2]+t*(b[4]-b[2]),b[3],b[4])
|
||||
end
|
||||
gc.setColor(1,1,1)
|
||||
for i=1,3 do
|
||||
gc.draw(PTC.attack[i])
|
||||
end
|
||||
setmetatable(_G,nil)
|
||||
end
|
||||
function Pnt.setting2()
|
||||
setFont(35)
|
||||
gc.setColor(1,1,1)
|
||||
mStr("DAS:"..setting.das,330,72)
|
||||
mStr("ARR:"..setting.arr,545,72)
|
||||
mStr("DAS:"..setting.das,830,72)
|
||||
mStr("ARR:"..setting.arr,1045,72)
|
||||
gc.setColor(1,1,1)
|
||||
for i=1,9 do
|
||||
gc.printf(actName_show[i]..":",100,60*i-8,200,"right")
|
||||
@@ -295,7 +290,7 @@ end
|
||||
function Pnt.stat()
|
||||
setFont(30)
|
||||
gc.setColor(1,1,1)
|
||||
for i=1,6 do
|
||||
for i=1,10 do
|
||||
gc.print(Text.stat[i],250,20+40*i)
|
||||
end
|
||||
|
||||
@@ -305,5 +300,10 @@ function Pnt.stat()
|
||||
gc.print(stat.piece,600,180)
|
||||
gc.print(stat.row,600,220)
|
||||
gc.print(stat.atk,600,260)
|
||||
gc.print(stat.key,600,300)
|
||||
gc.print(stat.rotate,600,340)
|
||||
gc.print(stat.hold,600,380)
|
||||
gc.print(stat.spin,600,420)
|
||||
|
||||
gc.draw(img.title[setting.lang],180,600,.2,.7+.05*sin(Timer()*2),nil,140,100)
|
||||
end
|
||||
42
timer.lua
42
timer.lua
@@ -40,6 +40,21 @@ end
|
||||
function Tmr.play(dt)
|
||||
frame=frame+1
|
||||
stat.gametime=stat.gametime+dt
|
||||
|
||||
for i=#FX.beam,1,-1 do
|
||||
local b=FX.beam[i]
|
||||
b.t=b.t+1
|
||||
local t=b.t*.025
|
||||
PTC.attack[b.lv]:setPosition(b[1]+(b[3]-b[1])*t,b[2]+(b[4]-b[2])*t-100*(4*t*(1-t)))
|
||||
PTC.attack[b.lv]:emit(1)
|
||||
if t==1 then
|
||||
rem(FX.beam,i)
|
||||
end
|
||||
end
|
||||
for i=1,3 do
|
||||
PTC.attack[i]:update(dt)
|
||||
end
|
||||
-- Update attack beam
|
||||
if count then
|
||||
count=count-1
|
||||
if count==0 then
|
||||
@@ -57,8 +72,20 @@ function Tmr.play(dt)
|
||||
elseif count%60==0 then
|
||||
SFX("ready")
|
||||
end
|
||||
return nil
|
||||
end--Start counting
|
||||
|
||||
if count then
|
||||
for p=1,#players do
|
||||
P=players[p]
|
||||
setmetatable(_G,P.index)
|
||||
if keyPressing[1]or keyPressing[2]then
|
||||
P.moving=moving+sgn(moving)
|
||||
else
|
||||
P.moving=0
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
end--Start counting,include pre-das
|
||||
for p=1,#players do
|
||||
P=players[p]
|
||||
setmetatable(_G,P.index)
|
||||
@@ -139,6 +166,7 @@ function Tmr.play(dt)
|
||||
end
|
||||
end
|
||||
end
|
||||
if P.b2b>480 then P.b2b=P.b2b-1 end
|
||||
else--Alive
|
||||
P.keySpeed=keySpeed*.96+cstat.key/time*60*.04
|
||||
P.dropSpeed=dropSpeed*.96+cstat.piece/time*60*.04
|
||||
@@ -156,8 +184,7 @@ function Tmr.play(dt)
|
||||
end--Rows cleared drop
|
||||
for j=1,#field do for i=1,10 do
|
||||
if visTime[j][i]<20 then P.visTime[j][i]=visTime[j][i]+.5 end
|
||||
end end
|
||||
--Make field visible
|
||||
end end--Make field visible
|
||||
end--Dead
|
||||
for i=#bonus,1,-1 do
|
||||
bonus[i].t=bonus[i].t+1
|
||||
@@ -180,13 +207,8 @@ function Tmr.play(dt)
|
||||
end
|
||||
end
|
||||
if fieldBeneath>0 then P.fieldBeneath=fieldBeneath-2 end
|
||||
P.b2b1=P.b2b1*.95+P.b2b*.05
|
||||
PTC.dust[p]:update(dt)
|
||||
end
|
||||
for i=#FX.beam,1,-1 do
|
||||
FX.beam[i].t=FX.beam[i].t+1
|
||||
if FX.beam[i].t>30 then
|
||||
rem(FX.beam,i)
|
||||
end
|
||||
end
|
||||
setmetatable(_G,nil)
|
||||
end
|
||||
Reference in New Issue
Block a user