0.190726α
This commit is contained in:
116
button.lua
116
button.lua
@@ -2,72 +2,90 @@ Buttons={
|
||||
load={},
|
||||
intro={},
|
||||
main={
|
||||
{x=500,y=300,w=320,h=60,rgb={1,0,0},alpha=0,t="Play",code=function()gotoScene("mode")end},
|
||||
{x=500,y=380,w=320,h=60,rgb={0,0,1},alpha=0,t="Settings",code=function()gotoScene("setting")end},
|
||||
{x=415,y=460,w=150,h=60,rgb={1,1,0},alpha=0,t="Help",code=function()gotoScene("help")end},
|
||||
{x=585,y=460,w=150,h=60,rgb={0,1,1},alpha=0,t="Statistics",code=function()gotoScene("stat")end},
|
||||
{x=500,y=540,w=320,h=60,rgb={.5,.5,.5},alpha=0,t="Quit",code=function()gotoScene("quit")end},
|
||||
{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},
|
||||
},
|
||||
mode={
|
||||
{x=200,y=150,w=250,h=70,rgb={1,1,1},alpha=0,t="40 Lines",code=function()startGame("sprint")end},
|
||||
{x=500,y=150,w=250,h=70,rgb={1,1,1},alpha=0,t="Zen",code=function()startGame("zen")end},
|
||||
{x=800,y=150,w=250,h=70,rgb={1,1,1},alpha=0,t="GM Roll",code=function()startGame("gmroll")end},
|
||||
{x=200,y=250,w=250,h=70,rgb={1,1,1},alpha=0,t="Marathon",code=function()startGame("marathon")end},
|
||||
{x=200,y=350,w=250,h=70,rgb={1,1,1},alpha=0,t="Death",code=function()startGame("death")end},
|
||||
{x=500,y=250,w=250,h=70,rgb={1,1,1},alpha=0,t="Tetris 25",code=function()startGame("tetris25")end},
|
||||
{x=500,y=350,w=250,h=70,rgb={1,1,1},alpha=0,t="AI Solo",code=function()startGame("solo")end},
|
||||
{x=800,y=250,w=250,h=70,rgb={1,1,1},alpha=0,t="Blind",code=function()startGame("blind")end},
|
||||
{x=800,y=350,w=250,h=70,rgb={1,1,1},alpha=0,t="Asymmetry Solo",code=function()startGame("asymsolo")end},
|
||||
{x=500,y=520,w=350,h=80,rgb={1,1,1},alpha=0,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},
|
||||
{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},
|
||||
},
|
||||
play={
|
||||
{x=950,y=30,w=80,h=40,rgb={1,1,1},alpha=0,t="Back",code=function()gotoScene("mode")end},
|
||||
{x=1230,y=30,w=80,h=40,rgb=color.white,t="Back",code=function()gotoScene("mode")end},
|
||||
},
|
||||
setting={
|
||||
{x=120,y=80,w=30,h=30,rgb={1,1,1},alpha=0,t="-",code=function()setting.das=(setting.das-1)%31 end,hold=true},
|
||||
{x=280,y=80,w=30,h=30,rgb={1,1,1},alpha=0,t="+",code=function()setting.das=(setting.das+1)%31 end,hold=true},
|
||||
{x=320,y=80,w=30,h=30,rgb={1,1,1},alpha=0,t="-",code=function()setting.arr=(setting.arr-1)%16 end,hold=true},
|
||||
{x=480,y=80,w=30,h=30,rgb={1,1,1},alpha=0,t="+",code=function()setting.arr=(setting.arr+1)%16 end,hold=true},
|
||||
{x=200,y=200,w=190,h=40,rgb={1,1,1},alpha=0,t=function()return setting.ghost and"Ghost ON"or"Ghost OFF"end,code=function()setting.ghost=not setting.ghost end},
|
||||
{x=400,y=200,w=190,h=40,rgb={1,1,1},alpha=0,t=function()return setting.center and"Center ON"or"Center OFF"end,code=function()setting.center=not setting.center end},
|
||||
|
||||
|
||||
{x=700,y=80,w=280,h=50,rgb={1,1,1},alpha=0,t=function()return setting.sfx and"Disable SFX"or"Enable SFX"end,code=function()setting.sfx=not setting.sfx end},
|
||||
{x=700,y=150,w=280,h=50,rgb={1,1,1},alpha=0,t=function()return setting.bgm and"Disable BGM"or"Enable BGM"end,
|
||||
code=function()
|
||||
setting.bgm=not setting.bgm
|
||||
if setting.bgm then BGM("blank")else BGM()end
|
||||
end
|
||||
},
|
||||
{x=700,y=220,w=280,h=50,rgb={1,1,1},alpha=0,t=function()return setting.fullscreen and"Disable fullscreen"or"Enable fullscreen"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},
|
||||
{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=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
|
||||
},
|
||||
|
||||
{x=300,y=400,w=230,h=50,rgb={1,1,1},alpha=0,t="More settings",code=function()gotoScene("setting2")end},
|
||||
{x=500,y=500,w=100,h=50,rgb={1,1,1},alpha=0,t="Back",code=function()back()end},
|
||||
{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},
|
||||
},
|
||||
setting2={
|
||||
{x=350,y=70,w=210,h=43,rgb={1,1,1},alpha=0,t=function()return setting.key[1]end,code=function()keysetting=1 end},
|
||||
{x=350,y=120,w=210,h=43,rgb={1,1,1},alpha=0,t=function()return setting.key[2]end,code=function()keysetting=2 end},
|
||||
{x=350,y=170,w=210,h=43,rgb={1,1,1},alpha=0,t=function()return setting.key[3]end,code=function()keysetting=3 end},
|
||||
{x=350,y=220,w=210,h=43,rgb={1,1,1},alpha=0,t=function()return setting.key[4]end,code=function()keysetting=4 end},
|
||||
{x=350,y=270,w=210,h=43,rgb={1,1,1},alpha=0,t=function()return setting.key[5]end,code=function()keysetting=5 end},
|
||||
{x=350,y=320,w=210,h=43,rgb={1,1,1},alpha=0,t=function()return setting.key[6]end,code=function()keysetting=6 end},
|
||||
{x=350,y=370,w=210,h=43,rgb={1,1,1},alpha=0,t=function()return setting.key[7]end,code=function()keysetting=7 end},
|
||||
{x=350,y=420,w=210,h=43,rgb={1,1,1},alpha=0,t=function()return setting.key[8]end,code=function()keysetting=8 end},
|
||||
{x=350,y=470,w=210,h=43,rgb={1,1,1},alpha=0,t=function()return setting.key[9]end,code=function()keysetting=9 end},
|
||||
{x=320,y=550,w=130,h=43,rgb={1,1,1},alpha=0,t="Reset",code=function()setting.key={"left","right","x","z","c","up","down","space","r","LEFT","RIGHT"}end},
|
||||
{x=500,y=550,w=100,h=50,rgb={1,1,1},alpha=0,t="Back",code=function()back()end},
|
||||
{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},
|
||||
},
|
||||
help={
|
||||
{x=500,y=500,w=200,h=60,rgb={1,1,1},alpha=0,t="Back",code=function()back()end},
|
||||
{x=640,y=590,w=180,h=60,rgb=color.white,t="Back",code=function()back()end},
|
||||
},
|
||||
stat={
|
||||
{x=500,y=500,w=200,h=60,rgb={1,1,1},alpha=0,t="Back",code=function()back()end},
|
||||
{x=640,y=590,w=180,h=60,rgb=color.white,t="Back",code=function()back()end},
|
||||
},
|
||||
sel=nil,--selected button Obj
|
||||
pressing=0,--pressing time
|
||||
}
|
||||
}
|
||||
for k,v in pairs(Buttons)do
|
||||
if type(v)=="table"then
|
||||
for i=1,#v do
|
||||
v[i].alpha=0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
gamePad={
|
||||
{x=0,y=0,r=60},--moveLeft
|
||||
{x=0,y=0,r=60},--moveRight
|
||||
{x=0,y=0,r=60},--rotLeft
|
||||
{x=0,y=0,r=60},--rotRight
|
||||
{x=0,y=0,r=60},--rotFlip
|
||||
{x=0,y=0,r=60},--hardDrop
|
||||
{x=0,y=0,r=60},--softDrop
|
||||
{x=0,y=0,r=60},--hold
|
||||
{x=0,y=0,r=60},--restart
|
||||
{x=0,y=0,r=60},--toLeft
|
||||
{x=0,y=0,r=60},--toRight
|
||||
{x=0,y=0,r=60},--toDown
|
||||
}
|
||||
for i=1,#gamePad do
|
||||
gamePad[i].press=false
|
||||
gamePad[i].r=gamePad[i].r^2
|
||||
end
|
||||
Reference in New Issue
Block a user