Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e073d1bb6 | ||
|
|
2fbb295490 | ||
|
|
b72631cd82 | ||
|
|
832c09980a | ||
|
|
ca68a8ef87 | ||
|
|
0645cec207 | ||
|
|
53dde3ec9e | ||
|
|
df5c16e05f | ||
|
|
bb3bb938e8 | ||
|
|
c196a2104e | ||
|
|
c78c596095 | ||
|
|
8d2d0f0b22 | ||
|
|
26d06e8f3a | ||
|
|
59eb8ae7f1 | ||
|
|
7d932016b8 | ||
|
|
998eb56348 | ||
|
|
7837064e80 | ||
|
|
53745c61e5 | ||
|
|
14adcff9dc | ||
|
|
7d67288766 | ||
|
|
d904b126df | ||
|
|
649df9be49 | ||
|
|
4e49c1f80d |
@@ -124,7 +124,7 @@ function love.mousepressed(x,y,k,touch)
|
||||
WIDGET.press(mx,my)
|
||||
end
|
||||
lastX,lastY=mx,my
|
||||
SYSFX.newTap(3,mx,my,30)
|
||||
if SETTING.clickFX then SYSFX.newTap(3,mx,my,30)end
|
||||
end
|
||||
function love.mousemoved(x,y,dx,dy,touch)
|
||||
if touch then return end
|
||||
@@ -194,7 +194,7 @@ function love.touchreleased(id,x,y)
|
||||
if SCN.touchUp then SCN.touchUp(x,y)end
|
||||
if(x-lastX)^2+(y-lastY)^2<62 then
|
||||
if SCN.touchClick then SCN.touchClick(x,y)end
|
||||
SYSFX.newTap(3,x,y,30)
|
||||
if SETTING.clickFX then SYSFX.newTap(3,x,y,30)end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
local find,sub=string.find,string.sub
|
||||
return function(s,sep)
|
||||
return function(s,sep,regex)
|
||||
local L={}
|
||||
local p1,p2=1--start,target
|
||||
while p1<=#s do
|
||||
p2=find(s,sep,p1)or #s+1
|
||||
L[#L+1]=sub(s,p1,p2-1)
|
||||
p1=p2+#sep
|
||||
if regex then
|
||||
while p1<=#s do
|
||||
p2=find(s,sep,p1)or #s+1
|
||||
L[#L+1]=sub(s,p1,p2-1)
|
||||
p1=p2+#sep
|
||||
end
|
||||
else
|
||||
while p1<=#s do
|
||||
p2=find(s,sep,p1,true)or #s+1
|
||||
L[#L+1]=sub(s,p1,p2-1)
|
||||
p1=p2+#sep
|
||||
end
|
||||
end
|
||||
return L
|
||||
end
|
||||
@@ -31,9 +31,13 @@ function THEME.calculate(Y,M,D)
|
||||
M=="04"and D=="01"and
|
||||
"fool"or
|
||||
|
||||
--Z day (Feb./Mar./Apr./May./June 26)
|
||||
math.abs(M-4)<=2 and D+0==26 and
|
||||
"zday"or
|
||||
--Z day (1) (Feb./Mar./Apr. 26)
|
||||
math.abs(M-3)<=1 and D=="26"and
|
||||
"zday1"or
|
||||
|
||||
--Z day (2) (May./June 26)
|
||||
math.abs(M-5.5)<=1 and D=="26"and
|
||||
"zday2"or
|
||||
|
||||
"classic"
|
||||
end
|
||||
@@ -54,9 +58,12 @@ function THEME.set(theme)
|
||||
LOG.print(" ★☆☆★",COLOR.red)
|
||||
LOG.print("新年快乐!",COLOR.white)
|
||||
LOG.print(" ★☆☆★",COLOR.red)
|
||||
elseif theme=="zday"then
|
||||
elseif theme=="zday1"then
|
||||
BG.setDefault("lanterns")
|
||||
BGM.setDefault("overzero")
|
||||
elseif theme=="zday2"then
|
||||
BG.setDefault("lanterns")
|
||||
BGM.setDefault("vacuum")
|
||||
elseif theme=="fool"then
|
||||
BG.setDefault("blockrain")
|
||||
BGM.setDefault("how feeling")
|
||||
|
||||
@@ -86,9 +86,9 @@ local _send do
|
||||
local mask_key={1,14,5,14}
|
||||
local mask_str=char(unpack(mask_key))
|
||||
|
||||
function _send(opcode,message)
|
||||
function _send(op,message)
|
||||
--Message type
|
||||
SOCK:send(char(bor(0x80,opcode)))
|
||||
SOCK:send(char(bor(0x80,op)))
|
||||
|
||||
if message then
|
||||
--Length
|
||||
|
||||
6
conf.lua
6
conf.lua
@@ -1,7 +1,7 @@
|
||||
VERSION={
|
||||
code=1403,
|
||||
string="Alpha V0.14.3",
|
||||
name="曙光 Morning Twilight",
|
||||
code=1404,
|
||||
string="Alpha V0.14.4",
|
||||
name="日出 Sunrise",
|
||||
}
|
||||
function love.conf(t)
|
||||
t.identity="Techmino"--Saving folder
|
||||
|
||||
47
main.lua
47
main.lua
@@ -33,40 +33,24 @@ love.keyboard.setKeyRepeat(true)
|
||||
love.keyboard.setTextInput(false)
|
||||
love.mouse.setVisible(false)
|
||||
|
||||
--Delete all files from too old version
|
||||
for _,name in next,fs.getDirectoryItems("")do
|
||||
if fs.getRealDirectory(name)==SAVEDIR and fs.getInfo(name).type~="directory"then
|
||||
fs.remove(name)
|
||||
end
|
||||
end
|
||||
|
||||
--Create directories
|
||||
for _,v in next,{"conf","record","replay","cache"}do
|
||||
local info=fs.getInfo(v)
|
||||
if not info then
|
||||
fs.createDirectory(v)
|
||||
elseif info.type ~= 'directory' then
|
||||
elseif info.type~="directory"then
|
||||
fs.remove(v)
|
||||
fs.createDirectory(v)
|
||||
end
|
||||
end
|
||||
|
||||
--Collect files of old version
|
||||
if fs.getInfo("data.dat")or fs.getInfo("key.dat")or fs.getInfo("settings.dat")then
|
||||
for k,v in next,{
|
||||
["settings.dat"]="conf/settings",
|
||||
["unlock.dat"]="conf/unlock",
|
||||
["data.dat"]="conf/data",
|
||||
["key.dat"]="conf/key",
|
||||
["virtualkey.dat"]="conf/virtualkey",
|
||||
["account.dat"]="conf/user",
|
||||
}do
|
||||
if fs.getInfo(k)then
|
||||
fs.write(v,fs.read(k))
|
||||
fs.remove(k)
|
||||
end
|
||||
end
|
||||
for _,name in next,fs.getDirectoryItems("")do
|
||||
if name:sub(-4)==".dat"then
|
||||
fs.write("record/"..name:sub(1,-4).."rec",fs.read(name))
|
||||
fs.remove(name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--Load modules
|
||||
require"Zframework"
|
||||
|
||||
@@ -274,6 +258,7 @@ do
|
||||
end
|
||||
if STAT.version<1400 then
|
||||
fs.remove("conf/user")
|
||||
fs.remove("conf/key")
|
||||
SETTING.appLock=false
|
||||
needSave=true
|
||||
autoRestart=true
|
||||
@@ -316,16 +301,6 @@ do
|
||||
RANKS.sprint_10l=0
|
||||
needSave=true
|
||||
end
|
||||
if needSave then
|
||||
FILE.save(RANKS,"conf/unlock","q")
|
||||
FILE.save(SETTING,"conf/settings","q")
|
||||
end
|
||||
|
||||
if keyMap[1]then
|
||||
autoRestart=true
|
||||
fs.remove("conf/key")
|
||||
end
|
||||
USER.username=nil
|
||||
|
||||
if STAT.version~=VERSION.code then
|
||||
newVersionLaunch=true
|
||||
@@ -333,6 +308,10 @@ do
|
||||
FILE.save(STAT,"conf/data","q")
|
||||
end
|
||||
|
||||
if needSave then
|
||||
FILE.save(RANKS,"conf/unlock","q")
|
||||
FILE.save(SETTING,"conf/settings","q")
|
||||
end
|
||||
if autoRestart then
|
||||
love.event.quit("restart")
|
||||
end
|
||||
|
||||
BIN
media/BGM/super7th.ogg
Normal file
BIN
media/BGM/super7th.ogg
Normal file
Binary file not shown.
BIN
media/BGM/vacuum.ogg
Normal file
BIN
media/BGM/vacuum.ogg
Normal file
Binary file not shown.
@@ -276,6 +276,7 @@ SETTING={--Settings
|
||||
fullscreen=true,
|
||||
bg=true,
|
||||
powerInfo=false,
|
||||
clickFX=true,
|
||||
|
||||
--Sound
|
||||
sfx=1,
|
||||
|
||||
@@ -259,7 +259,8 @@ return{
|
||||
down="↓",
|
||||
},
|
||||
net_game={
|
||||
ready="Ready/Cancel",
|
||||
ready="Ready",
|
||||
cancel="Cancel",
|
||||
},
|
||||
net_chat={
|
||||
send="Send",
|
||||
@@ -310,8 +311,9 @@ return{
|
||||
highCam="Screen Scrolling",
|
||||
nextPos="Next Preview",
|
||||
fullscreen="Full Screen",
|
||||
bg="Background",
|
||||
power="Power Info",
|
||||
clickFX="Click FX",
|
||||
bg="Background",
|
||||
clean="Fast Draw",
|
||||
},
|
||||
setting_sound={
|
||||
|
||||
@@ -231,7 +231,8 @@ return{
|
||||
down="↓",
|
||||
},
|
||||
net_game={
|
||||
-- ready="Ready/Cancel",
|
||||
-- ready="Ready",
|
||||
-- cancel="Cancel",
|
||||
},
|
||||
net_chat={
|
||||
send="Envoyer",
|
||||
@@ -284,8 +285,9 @@ return{
|
||||
highCam="Vue d'oiseau",
|
||||
nextPos="Prévisualisation de position",
|
||||
fullscreen="Plein écran",
|
||||
bg="Arrière-plan",
|
||||
power="Infos d'alimentation",
|
||||
-- clickFX="Click FX",
|
||||
bg="Arrière-plan",
|
||||
-- clean="Fast Draw",
|
||||
},
|
||||
setting_sound={
|
||||
|
||||
@@ -259,7 +259,8 @@ return{
|
||||
down="↓",
|
||||
},
|
||||
net_game={
|
||||
-- ready="Ready/Cancel",
|
||||
-- ready="Ready",
|
||||
-- cancel="Cancel",
|
||||
},
|
||||
net_chat={
|
||||
send="Mandar",
|
||||
@@ -310,8 +311,9 @@ return{
|
||||
highCam="Vista Olho-de-pássaro",
|
||||
nextPos="Próxima Pos.",
|
||||
fullscreen="Tela cheia",
|
||||
bg="Fundo",
|
||||
power="Informação bateria",
|
||||
-- clickFX="Click FX",
|
||||
bg="Fundo",
|
||||
-- clean="Fast Draw",
|
||||
},
|
||||
setting_sound={
|
||||
|
||||
@@ -238,6 +238,7 @@ return{
|
||||
},
|
||||
net_game={
|
||||
ready="Estoy Listo",
|
||||
-- cancel="Cancel",
|
||||
},
|
||||
net_chat={
|
||||
send="Enviar",
|
||||
@@ -288,8 +289,9 @@ return{
|
||||
highCam="Cám. Vista Aérea",
|
||||
nextPos="Ver Spawn de Pza. Sig.",
|
||||
fullscreen="Pant. Completa",
|
||||
bg="Fondo",
|
||||
power="Inf. de Batería",
|
||||
-- clickFX="Click FX",
|
||||
bg="Fondo",
|
||||
clean="Fast Draw",
|
||||
},
|
||||
setting_sound={
|
||||
|
||||
@@ -169,8 +169,9 @@ return{
|
||||
highCam="↑__↑",
|
||||
nextPos="???←",
|
||||
fullscreen="|←→|",
|
||||
bg="__?__",
|
||||
power="+.",
|
||||
clickFX="_.~",
|
||||
bg="__?__",
|
||||
clean="[]→→O",
|
||||
},
|
||||
setting_sound={
|
||||
|
||||
@@ -259,7 +259,8 @@ return{
|
||||
down="↓",
|
||||
},
|
||||
net_game={
|
||||
ready="准备/取消",
|
||||
ready="准备",
|
||||
cancel="取消",
|
||||
},
|
||||
net_chat={
|
||||
send="发送",
|
||||
@@ -310,8 +311,9 @@ return{
|
||||
highCam="超屏视野",
|
||||
nextPos="生成预览",
|
||||
fullscreen="全屏",
|
||||
bg="背景",
|
||||
power="电量显示",
|
||||
clickFX="点按特效",
|
||||
bg="背景",
|
||||
clean="绘制优化",
|
||||
},
|
||||
setting_sound={
|
||||
|
||||
@@ -6,7 +6,7 @@ return{
|
||||
visible="easy",
|
||||
dropPiece=function(P)if P.stat.row>=200 then P:win("finish")end end,
|
||||
freshLimit=10,
|
||||
bg="glow",bgm="reason",
|
||||
bg="glow",bgm="push",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
|
||||
@@ -10,7 +10,7 @@ return{
|
||||
score=false,
|
||||
dropPiece=function(P)if P.stat.row>=200 then P:win("finish")end end,
|
||||
freshLimit=15,
|
||||
bg="rgb",bgm="reason",
|
||||
bg="rgb",bgm="push",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
|
||||
@@ -11,7 +11,7 @@ return{
|
||||
score=false,
|
||||
dropPiece=function(P)if P.stat.row>=200 then P:win("finish")end end,
|
||||
freshLimit=15,
|
||||
bg="rgb",bgm="reason",
|
||||
bg="rgb",bgm="push",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
|
||||
@@ -7,7 +7,7 @@ return{
|
||||
freshLimit=10,
|
||||
visible="fast",
|
||||
dropPiece=function(P)if P.stat.row>=200 then P:win("finish")end end,
|
||||
bg="glow",bgm="reason",
|
||||
bg="glow",bgm="push",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
|
||||
@@ -10,7 +10,7 @@ return{
|
||||
score=false,
|
||||
dropPiece=function(P)if P.stat.row>=100 then P:win("finish")end end,
|
||||
freshLimit=15,
|
||||
bg="rgb",bgm="push",
|
||||
bg="rgb",bgm="far",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
|
||||
@@ -10,7 +10,7 @@ return{
|
||||
visible="none",
|
||||
dropPiece=function(P)if P.stat.row>=40 then P:win("finish")end end,
|
||||
freshLimit=15,
|
||||
bg="none",bgm="push",
|
||||
bg="none",bgm="far",
|
||||
},
|
||||
pauseLimit=true,
|
||||
load=function()
|
||||
|
||||
@@ -14,7 +14,7 @@ return{
|
||||
local p=P.modeData.pt+P.lastPiece.row
|
||||
if p>=P.modeData.target then
|
||||
local ENV=P.gameEnv
|
||||
local T=ENV.target
|
||||
local T=P.modeData.target
|
||||
--Stage 1: clear 3 techrash
|
||||
if T==12 then--Stage 2: swap color of S/Z & J/L
|
||||
P.waiting=30
|
||||
@@ -28,7 +28,7 @@ return{
|
||||
ENV.fall=7
|
||||
P:setNext(4)
|
||||
|
||||
ENV.target=26
|
||||
P.modeData.target=26
|
||||
SFX.play("reach")
|
||||
elseif T==26 then--Stage 3: dig to bottom
|
||||
if not P.holdQueue[1]then P.life=P.life+1 end--1 up if ban hold
|
||||
@@ -70,7 +70,7 @@ return{
|
||||
ENV.fall=6
|
||||
P:setNext(5)
|
||||
|
||||
ENV.target=42
|
||||
P.modeData.target=42
|
||||
SFX.play("reach")
|
||||
elseif T==42 then--Stage 4: survive in high speed
|
||||
if P.garbageBeneath==0 then
|
||||
@@ -80,7 +80,7 @@ return{
|
||||
P:setHold(false)
|
||||
ENV.bone=true
|
||||
|
||||
ENV.target=62
|
||||
P.modeData.target=62
|
||||
else
|
||||
p=41
|
||||
end
|
||||
@@ -92,7 +92,7 @@ return{
|
||||
|
||||
ENV.easyFresh=false
|
||||
|
||||
ENV.target=126
|
||||
P.modeData.target=126
|
||||
SFX.play("reach")
|
||||
elseif T==126 then--Stage 6: speed up
|
||||
P.life=P.life+1
|
||||
@@ -101,7 +101,7 @@ return{
|
||||
ENV.wait=4
|
||||
ENV.fall=4
|
||||
|
||||
ENV.target=162
|
||||
P.modeData.target=162
|
||||
elseif T==162 then--Stage 7: speed up+++
|
||||
P.life=P.life+1
|
||||
|
||||
@@ -110,7 +110,7 @@ return{
|
||||
P:setHold(true)
|
||||
P:setInvisible(180)
|
||||
|
||||
ENV.target=226
|
||||
P.modeData.target=226
|
||||
SFX.play("reach")
|
||||
elseif T==226 then--Stage 8: final invisible
|
||||
P.life=P.life+2
|
||||
@@ -118,7 +118,7 @@ return{
|
||||
ENV.bone=false
|
||||
P:setInvisible(90)
|
||||
|
||||
ENV.target=259
|
||||
P.modeData.target=259
|
||||
SFX.play("reach")
|
||||
elseif T==259 then--Stage 9: ending
|
||||
P.life=P.life+1
|
||||
@@ -130,7 +130,7 @@ return{
|
||||
ENV.mission={4,4,4,4,4,4,4,4}
|
||||
ENV.missionKill=false
|
||||
|
||||
ENV.target=260
|
||||
P.modeData.target=260
|
||||
p=260
|
||||
SFX.play("blip_2")
|
||||
else
|
||||
@@ -142,7 +142,7 @@ return{
|
||||
mission={4,4,4,64},
|
||||
missionKill=true,
|
||||
freshLimit=12,
|
||||
bg="none",bgm="distortion",
|
||||
bg="none",bgm="super7th",
|
||||
},
|
||||
slowMark=true,
|
||||
load=function()
|
||||
|
||||
@@ -134,7 +134,7 @@ function NET.register(username,email,password)
|
||||
end
|
||||
end
|
||||
function NET.pong(wsName,message)
|
||||
WS.send(wsName,message,"pong")
|
||||
WS.send(wsName,type(message)=="string"and message or"","pong")
|
||||
end
|
||||
function NET.getAccessToken()
|
||||
if NET.lock("access_and_login",10)then
|
||||
@@ -385,7 +385,7 @@ function NET.updateWS_play()
|
||||
ready=d.ready,
|
||||
config=d.config,
|
||||
})
|
||||
SCN.socketRead("Join",d)
|
||||
if SCN.socketRead then SCN.socketRead("Join",d)end
|
||||
end
|
||||
elseif res.action==3 then--Player leave
|
||||
if not d.uid then
|
||||
@@ -411,10 +411,10 @@ function NET.updateWS_play()
|
||||
break
|
||||
end
|
||||
end
|
||||
SCN.socketRead("Leave",d)
|
||||
if SCN.socketRead then SCN.socketRead("Leave",d)end
|
||||
end
|
||||
elseif res.action==4 then--Player talk
|
||||
SCN.socketRead("Talk",d)
|
||||
if SCN.socketRead then SCN.socketRead("Talk",d)end
|
||||
elseif res.action==5 then--Player change settings
|
||||
if tostring(USER.uid)~=d.uid then
|
||||
for i=1,#PLY_NET do
|
||||
@@ -434,12 +434,12 @@ function NET.updateWS_play()
|
||||
SFX.play("spin_0",.6)
|
||||
if i==1 then
|
||||
NET.unlock("ready")
|
||||
else
|
||||
elseif not PLY_NET[1].ready then
|
||||
for j=2,#PLY_NET do
|
||||
if not PLY_NET[j].ready then
|
||||
break
|
||||
elseif j==#PLY_NET then
|
||||
SFX.play("warning",.5)
|
||||
SFX.play("blip_2",.5)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -454,8 +454,8 @@ function NET.updateWS_play()
|
||||
NET.wsconn_stream()
|
||||
TASK.new(NET.updateWS_stream)
|
||||
elseif res.action==9 then--Game finished
|
||||
SCN.socketRead("Finish",d)
|
||||
NET.wsclose_stream()
|
||||
if SCN.socketRead then SCN.socketRead("Finish",d)end
|
||||
end
|
||||
else
|
||||
WS.alert("play")
|
||||
@@ -493,7 +493,13 @@ function NET.updateWS_stream()
|
||||
elseif res.action==3 then--Player leave
|
||||
--?
|
||||
elseif res.action==4 then--Player died
|
||||
--?
|
||||
local uid=res.data.uid
|
||||
for _,P in next,PLY_ALIVE do
|
||||
if P.uid==uid then
|
||||
P:lose(true)
|
||||
break
|
||||
end
|
||||
end
|
||||
elseif res.action==5 then--Receive stream
|
||||
SCN.socketRead("Stream",d)
|
||||
end
|
||||
|
||||
@@ -20,6 +20,7 @@ local seqGens={
|
||||
end,
|
||||
his4=function(P,seq0)
|
||||
local len=#seq0
|
||||
local his={0,0,0,0}
|
||||
while true do
|
||||
while #P.nextQueue<6 do
|
||||
for n=1,4 do
|
||||
@@ -27,8 +28,8 @@ local seqGens={
|
||||
repeat
|
||||
i=seq0[P:RND(len)]
|
||||
j=j+1
|
||||
until i~=seq0[1]and i~=seq0[2]and i~=seq0[3]and i~=seq0[4]or j==4
|
||||
seq0[n]=i
|
||||
until i~=his[1]and i~=his[2]and i~=his[3]and i~=his[4]or j==4
|
||||
his[n]=i
|
||||
P:getNext(i)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -643,7 +643,8 @@ function Player:hold(ifpre)
|
||||
local ENV=self.gameEnv
|
||||
if self.holdTime>0 and(ifpre or self.waiting==-1)then
|
||||
if #self.holdQueue<ENV.holdCount and self.nextQueue[1]then--Skip
|
||||
ins(self.holdQueue,self:getBlock(self.cur.id))
|
||||
local C=self.cur
|
||||
ins(self.holdQueue,self:getBlock(C.id,C.name,C.color))
|
||||
|
||||
local t=self.holdTime
|
||||
self:popNext(true)
|
||||
@@ -730,16 +731,16 @@ function Player:hold(ifpre)
|
||||
end
|
||||
end
|
||||
|
||||
function Player:getBlock(n)--Get a block(id=n) object
|
||||
function Player:getBlock(id,name,color)--Get a block(id=n) object
|
||||
local E=self.gameEnv
|
||||
local dir=E.face[n]
|
||||
local dir=E.face[id]
|
||||
return{
|
||||
id=n,
|
||||
bk=BLOCKS[n][dir],
|
||||
sc=SCS[n][dir],
|
||||
id=id,
|
||||
dir=dir,
|
||||
name=n,
|
||||
color=E.bone and 17 or E.skin[n],
|
||||
bk=BLOCKS[id][dir],
|
||||
sc=SCS[id][dir],
|
||||
name=name or id,
|
||||
color=E.bone and 17 or color or E.skin[id],
|
||||
}
|
||||
end
|
||||
function Player:getNext(n)--Push a block(id=n) to nextQueue
|
||||
@@ -1723,6 +1724,7 @@ function Player:win(result)
|
||||
end
|
||||
function Player:lose(force)
|
||||
if self.result then return end
|
||||
if self.type=="remote"and not force then self.waiting=1e99 return end
|
||||
if self.life>0 and not force then
|
||||
self.waiting=62
|
||||
local h=#self.field
|
||||
|
||||
@@ -293,14 +293,11 @@ function scene.draw()
|
||||
for j=1,4 do
|
||||
if cx~=j or cy~=i then
|
||||
local N=board[i][j]
|
||||
local C=mono and 3 or color
|
||||
|
||||
local C=mono and 1 or color
|
||||
local back=backColor[C]
|
||||
local front=frontColor[C]
|
||||
|
||||
gc.setColor(back[N])
|
||||
gc.setColor(backColor[C][N])
|
||||
gc.rectangle("fill",j*160+163,i*160-117,154,154,8)
|
||||
gc.setColor(front[N])
|
||||
gc.setColor(frontColor[C][N])
|
||||
gc.rectangle("line",j*160+163,i*160-117,154,154,8)
|
||||
if not mono then
|
||||
gc.setColor(.1,.1,.1)
|
||||
|
||||
@@ -128,33 +128,34 @@ local function squash(L)
|
||||
local moved=false
|
||||
while true do
|
||||
p2=p1+1
|
||||
while not L[p2]do
|
||||
while not L[p2]and p2<5 do
|
||||
p2=p2+1
|
||||
if p2==5 then
|
||||
p1=p1+1
|
||||
if p1==4 then
|
||||
return L[1],L[2],L[3],L[4],moved
|
||||
end
|
||||
break
|
||||
end
|
||||
end
|
||||
if not L[p1]then--air←2
|
||||
L[p1],L[p2]=L[p2],false
|
||||
moved=true
|
||||
elseif L[p1]==L[p2]then--2←2
|
||||
L[p1],L[p2]=L[p1]+1,false
|
||||
if L[p1]>maxTile then
|
||||
freshMaxTile()
|
||||
if p2==5 then
|
||||
if p1==4 then
|
||||
return L[1],L[2],L[3],L[4],moved
|
||||
else
|
||||
p1=p1+1
|
||||
end
|
||||
else
|
||||
if not L[p1]then--air←2
|
||||
L[p1],L[p2]=L[p2],false
|
||||
moved=true
|
||||
elseif L[p1]==L[p2]then--2←2
|
||||
L[p1],L[p2]=L[p1]+1,false
|
||||
if L[p1]>maxTile then
|
||||
freshMaxTile()
|
||||
end
|
||||
L[p2]=false
|
||||
p1=p1+1
|
||||
moved=true
|
||||
elseif p1+1~=p2 then--2←4
|
||||
L[p1+1],L[p2]=L[p2],false
|
||||
p1=p1+1
|
||||
moved=true
|
||||
else--2,4
|
||||
p1=p1+1
|
||||
end
|
||||
L[p2]=false
|
||||
p1=p1+1
|
||||
moved=true
|
||||
elseif p1+1~=p2 then--2←4
|
||||
L[p1+1],L[p2]=L[p2],false
|
||||
p1=p1+1
|
||||
moved=true
|
||||
else--2,4
|
||||
p1=p1+1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -196,7 +196,7 @@ do--commands.help(arg)
|
||||
details={
|
||||
"Set background.",
|
||||
"",
|
||||
"Usage: setbg <classic|xmas|sprfes|zday>",
|
||||
"Usage: setbg <classic|xmas|sprfes|zday1|zday2>",
|
||||
},
|
||||
},
|
||||
theme={
|
||||
@@ -204,7 +204,7 @@ do--commands.help(arg)
|
||||
details={
|
||||
"Load a theme.",
|
||||
"",
|
||||
"Usage: theme <classic|xmas|sprfes|zday>",
|
||||
"Usage: theme <classic|xmas|sprfes|zday1|zday2>",
|
||||
},
|
||||
},
|
||||
demo={
|
||||
@@ -488,7 +488,7 @@ function commands.demo()
|
||||
SCN.go("test","none")
|
||||
end
|
||||
do--commands.applet(name)
|
||||
local appList={"15p","grid","pong","atoz","uttt","cube","2048","ten","tap","dtw","cannon","drppper","calc","reflect","polyforge"}
|
||||
local appList={"15p","grid","pong","atoz","uttt","cube","2048","ten","tap","dtw","cannon","drp","calc","reflect","polyforge"}
|
||||
local appScene={"app_15p","app_schulteG","app_pong","app_AtoZ","app_UTTT","app_cubefield","app_2048","app_ten","app_tap","app_dtw","app_cannon","app_dropper","app_calc","app_reflect","app_polyforge"}
|
||||
function commands.applet(name)
|
||||
if name=="-list"then
|
||||
|
||||
@@ -104,7 +104,7 @@ end
|
||||
|
||||
function scene.sceneInit()
|
||||
sure=0
|
||||
penColor=1
|
||||
penColor=-2
|
||||
penMode=false
|
||||
penX,penY=1,1
|
||||
demo=false
|
||||
|
||||
@@ -34,6 +34,7 @@ function scene.sceneInit()
|
||||
upstreamProgress=1
|
||||
end
|
||||
|
||||
scene.mouseDown=NULL
|
||||
function scene.touchDown(x,y)
|
||||
if noTouch or not playing then return end
|
||||
|
||||
@@ -274,6 +275,14 @@ scene.widgetList={
|
||||
return
|
||||
playing or
|
||||
not textBox.hide or
|
||||
PLY_NET[1].ready or
|
||||
NET.getlock("ready")
|
||||
end},
|
||||
WIDGET.newKey{name="cancel",x=900,y=560,w=400,h=100,color="grey",font=40,code=pressKey"space",hide=function()
|
||||
return
|
||||
playing or
|
||||
not textBox.hide or
|
||||
not PLY_NET[1].ready or
|
||||
NET.getlock("ready")
|
||||
end},
|
||||
WIDGET.newKey{name="hideChat",fText="...",x=380,y=35,w=60,font=35,code=pressKey"\\"},
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
local scene={}
|
||||
|
||||
local function legalEmail(e)
|
||||
e=SPLITSTR(e,"@")
|
||||
if #e~=2 then return false end
|
||||
if e[1]:sub(-1)=="."or e[2]:sub(-1)=="."then return false end
|
||||
local e1,e2=SPLITSTR(e[1],"."),SPLITSTR(e[2],".")
|
||||
if #e1*#e2==0 then return false end
|
||||
for _,v in next,e1 do if #v==0 then return false end end
|
||||
for _,v in next,e2 do if #v==0 then return false end end
|
||||
return true
|
||||
end
|
||||
|
||||
local function register()
|
||||
local username= WIDGET.active.username.value
|
||||
local email= WIDGET.active.email.value
|
||||
@@ -7,7 +18,7 @@ local function register()
|
||||
local password2=WIDGET.active.password2.value
|
||||
if #username==0 then
|
||||
LOG.print(text.noUsername)return
|
||||
elseif not email:match("^[a-zA-Z0-9_]+@[a-zA-Z0-9_-]+%.[a-zA-Z0-9_]+$")then
|
||||
elseif not legalEmail(email)then
|
||||
LOG.print(text.wrongEmail)return
|
||||
elseif #password==0 or #password2==0 then
|
||||
LOG.print(text.noPassword)return
|
||||
|
||||
@@ -13,22 +13,22 @@ scene.widgetList={
|
||||
WIDGET.newButton{name="sound", x=200, y=80,w=240,h=80,color="lCyan",font=35,code=swapScene"setting_sound","swipeR"},
|
||||
WIDGET.newButton{name="game", x=1080, y=80,w=240,h=80,color="lCyan",font=35,code=swapScene"setting_game","swipeL"},
|
||||
|
||||
WIDGET.newSwitch{name="block", x=340, y=150, disp=SETval("block"), code=SETrev("block")},
|
||||
WIDGET.newSwitch{name="smooth", x=340, y=210, disp=SETval("smooth"), code=SETrev("smooth")},
|
||||
WIDGET.newSwitch{name="upEdge", x=340, y=270, disp=SETval("upEdge"), code=SETrev("upEdge")},
|
||||
WIDGET.newSwitch{name="bagLine", x=340, y=330, disp=SETval("bagLine"), code=SETrev("bagLine")},
|
||||
WIDGET.newSwitch{name="block", x=290, y=165, disp=SETval("block"), code=SETrev("block")},
|
||||
WIDGET.newSwitch{name="smooth", x=290, y=215, disp=SETval("smooth"), code=SETrev("smooth")},
|
||||
WIDGET.newSwitch{name="upEdge", x=290, y=265, disp=SETval("upEdge"), code=SETrev("upEdge")},
|
||||
WIDGET.newSwitch{name="bagLine", x=290, y=315, disp=SETval("bagLine"), code=SETrev("bagLine")},
|
||||
|
||||
WIDGET.newSlider{name="ghost", x=630, y=180,w=200,unit=.6,disp=SETval("ghost"),show="percent",code=SETsto("ghost")},
|
||||
WIDGET.newSlider{name="grid", x=630, y=240,w=200,unit=.4,disp=SETval("grid"),show="percent", code=SETsto("grid")},
|
||||
WIDGET.newSlider{name="center", x=630, y=300,w=200,unit=1, disp=SETval("center"), code=SETsto("center")},
|
||||
WIDGET.newSlider{name="ghost", x=600, y=180,w=200,unit=.6,disp=SETval("ghost"),show="percent",code=SETsto("ghost")},
|
||||
WIDGET.newSlider{name="grid", x=600, y=240,w=200,unit=.4,disp=SETval("grid"),show="percent", code=SETsto("grid")},
|
||||
WIDGET.newSlider{name="center", x=600, y=300,w=200,unit=1, disp=SETval("center"), code=SETsto("center")},
|
||||
|
||||
WIDGET.newSlider{name="lockFX", x=350, y=375,w=373,unit=5, disp=SETval("lockFX"), code=SETsto("lockFX")},
|
||||
WIDGET.newSlider{name="dropFX", x=350, y=420,w=373,unit=5, disp=SETval("dropFX"), code=SETsto("dropFX")},
|
||||
WIDGET.newSlider{name="moveFX", x=350, y=465,w=373,unit=5, disp=SETval("moveFX"), code=SETsto("moveFX")},
|
||||
WIDGET.newSlider{name="clearFX", x=350, y=510,w=373,unit=5, disp=SETval("clearFX"), code=SETsto("clearFX")},
|
||||
WIDGET.newSlider{name="splashFX", x=350, y=555,w=373,unit=5, disp=SETval("splashFX"),code=SETsto("splashFX")},
|
||||
WIDGET.newSlider{name="shakeFX", x=350, y=600,w=373,unit=5, disp=SETval("shakeFX"), code=SETsto("shakeFX")},
|
||||
WIDGET.newSlider{name="atkFX", x=350, y=645,w=373,unit=5, disp=SETval("atkFX"), code=SETsto("atkFX")},
|
||||
WIDGET.newSlider{name="lockFX", x=250, y=375,w=373,unit=5, disp=SETval("lockFX"), code=SETsto("lockFX")},
|
||||
WIDGET.newSlider{name="dropFX", x=250, y=420,w=373,unit=5, disp=SETval("dropFX"), code=SETsto("dropFX")},
|
||||
WIDGET.newSlider{name="moveFX", x=250, y=465,w=373,unit=5, disp=SETval("moveFX"), code=SETsto("moveFX")},
|
||||
WIDGET.newSlider{name="clearFX", x=250, y=510,w=373,unit=5, disp=SETval("clearFX"), code=SETsto("clearFX")},
|
||||
WIDGET.newSlider{name="splashFX", x=250, y=555,w=373,unit=5, disp=SETval("splashFX"),code=SETsto("splashFX")},
|
||||
WIDGET.newSlider{name="shakeFX", x=250, y=600,w=373,unit=5, disp=SETval("shakeFX"), code=SETsto("shakeFX")},
|
||||
WIDGET.newSlider{name="atkFX", x=250, y=645,w=373,unit=5, disp=SETval("atkFX"), code=SETsto("atkFX")},
|
||||
WIDGET.newSlider{name="frame", x=350, y=690,w=373,unit=10,
|
||||
disp=function()
|
||||
return SETTING.frameMul>35 and SETTING.frameMul/10 or SETTING.frameMul/5-4
|
||||
@@ -37,20 +37,21 @@ scene.widgetList={
|
||||
SETTING.frameMul=i<5 and 5*i+20 or 10*i
|
||||
end},
|
||||
|
||||
WIDGET.newSwitch{name="text", x=1100, y=180,font=35,disp=SETval("text"), code=SETrev("text")},
|
||||
WIDGET.newSwitch{name="score", x=1100, y=240,font=35,disp=SETval("score"), code=SETrev("score")},
|
||||
WIDGET.newSwitch{name="warn", x=1100, y=300,font=35,disp=SETval("warn"), code=SETrev("warn")},
|
||||
WIDGET.newSwitch{name="highCam", x=1100, y=360,font=35,disp=SETval("highCam"),code=SETrev("highCam")},
|
||||
WIDGET.newSwitch{name="nextPos", x=1100, y=420,font=35,disp=SETval("nextPos"),code=SETrev("nextPos")},
|
||||
WIDGET.newSwitch{name="fullscreen",x=1100, y=480,disp=SETval("fullscreen"), code=switchFullscreen},
|
||||
WIDGET.newSwitch{name="bg", x=1100, y=540,font=35,disp=SETval("bg"),
|
||||
WIDGET.newSwitch{name="text", x=1140, y=160,font=35,disp=SETval("text"), code=SETrev("text")},
|
||||
WIDGET.newSwitch{name="score", x=1140, y=210,font=35,disp=SETval("score"), code=SETrev("score")},
|
||||
WIDGET.newSwitch{name="warn", x=1140, y=260,font=35,disp=SETval("warn"), code=SETrev("warn")},
|
||||
WIDGET.newSwitch{name="highCam", x=1140, y=310,font=35,disp=SETval("highCam"),code=SETrev("highCam")},
|
||||
WIDGET.newSwitch{name="nextPos", x=1140, y=360,font=35,disp=SETval("nextPos"),code=SETrev("nextPos")},
|
||||
WIDGET.newSwitch{name="fullscreen", x=1140, y=410,disp=SETval("fullscreen"), code=switchFullscreen},
|
||||
WIDGET.newSwitch{name="power", x=1140, y=460,font=35,disp=SETval("powerInfo"),code=SETrev("powerInfo")},
|
||||
WIDGET.newSwitch{name="clickFX", x=1140, y=510,font=35,disp=SETval("clickFX"),code=SETrev("clickFX")},
|
||||
WIDGET.newSwitch{name="bg", x=1140, y=560,font=35,disp=SETval("bg"),
|
||||
code=function()
|
||||
BG.set("none")
|
||||
SETTING.bg=not SETTING.bg
|
||||
BG.set()
|
||||
end},
|
||||
WIDGET.newSwitch{name="power", x=990, y=610,font=35,disp=SETval("powerInfo"),code=SETrev("powerInfo")},
|
||||
WIDGET.newSwitch{name="clean", x=990, y=670,font=35,disp=SETval("cleanCanvas"),code=SETrev("cleanCanvas")},
|
||||
WIDGET.newSwitch{name="clean", x=990, y=640,font=35,disp=SETval("cleanCanvas"),code=SETrev("cleanCanvas")},
|
||||
WIDGET.newButton{name="back", x=1140, y=640,w=170,h=80,font=40,code=backScene},
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,29 @@ return SPLITSTR([=[
|
||||
可选虚拟按键颜色; 工程编译到字节码; task-Z(新AI)
|
||||
录像回放菜单; 跳帧开关; 教学关; 超60帧; 热更新
|
||||
|
||||
0.14.4: 日出 Sunrise
|
||||
新增:
|
||||
添加触摸/点击特效开关
|
||||
新增BGM:super7th(用于master-ph模式)
|
||||
新增BGM:vacuum(用于节日主题)
|
||||
改动:
|
||||
自定义场地默认使用智能画笔
|
||||
对战房间的准备按钮颜色和文本会随状态改变
|
||||
联网对战时禁用鼠标右键返回
|
||||
添加触摸/点击特效开关
|
||||
修改隐形模式BGM配置
|
||||
更换催促等待提示音
|
||||
不再接受过老版本的存档
|
||||
修复:
|
||||
玩家死亡消息以服务器为准,录像不同步不再影响结算
|
||||
O块在变形后hold失去名字和颜色属性
|
||||
master-ph错误
|
||||
注册时部分合法邮箱格式会被判错
|
||||
his序列模式算法错误
|
||||
小程序2048出新格的逻辑错误
|
||||
小程序15p盲打颜色配置错误
|
||||
一个小程序入口名错误
|
||||
|
||||
0.14.3: 曙光 Morning Twilight
|
||||
改动:
|
||||
尝试进联网菜单的两步都完成前再次点击按钮无效
|
||||
|
||||
Reference in New Issue
Block a user