Compare commits

...

26 Commits

Author SHA1 Message Date
MrZ626
41eda72394 更新0.14.3的日志和版本号 2021-04-11 21:04:01 +08:00
MrZ626
8a49398740 修正说明书的错别字 2021-04-11 20:52:00 +08:00
MrZ626
6fbec2b298 自动登录时机修改为ws-app连接成功并且版本是最新 2021-04-11 20:43:29 +08:00
MrZ626
15d8bbead9 文本框控件不再有新消息提示音 2021-04-11 20:42:45 +08:00
MrZ626
f2d72d70f1 微调玩家准备相关交互 2021-04-11 20:42:24 +08:00
MrZ626
0bcfd10a9d 修复test场景触屏点击报错 2021-04-11 20:23:16 +08:00
MrZ626
324b4f1b38 进入联网菜单时获取授权操作的锁改为连接成功后释放 2021-04-11 20:16:47 +08:00
MrZ626
27f11db7f4 注册成功后自动返回主菜单 2021-04-11 16:09:48 +08:00
MrZ626
0c734c5351 更新赞助名单 2021-04-11 15:31:58 +08:00
MrZ626
48da6a84a6 进房固定1.26秒cd 2021-04-11 14:26:23 +08:00
MrZ626
21cb2657ca 整理代码 2021-04-11 14:22:51 +08:00
MrZ626
b7ee5e771e 完善0.14.2更新日志 2021-04-11 13:55:36 +08:00
MrZ626
4967782464 减少一个ws库debug开启后可能输出的信息 2021-04-11 13:37:23 +08:00
MrZ626
29582469d2 成功登录后不再尝试清除登录界面的输入框 2021-04-11 13:36:57 +08:00
MrZ626
18c1c9c69a 重新启用注册菜单 2021-04-11 13:36:04 +08:00
MrZ626
ed3521cc53 添加0.14.2版本号和版本说明 2021-04-11 02:23:14 +08:00
MrZ626
4795d77e84 整理代码(远程玩家录像播放) 2021-04-11 02:19:02 +08:00
MrZ626
e0c594c402 攻击特效从全局改为玩家设置项一部分 2021-04-11 02:18:01 +08:00
MrZ626
5f02042124 微调联网游戏房间内ui 2021-04-11 01:57:03 +08:00
MrZ626
4b09023b21 修改词典的techmino词条,加上联网功能说明 2021-04-11 01:52:45 +08:00
MrZ626
320197198b 整理代码 2021-04-11 01:50:52 +08:00
MrZ626
d31423d91e 删除马拉松模式忘了删的测试代码 2021-04-10 23:00:23 +08:00
MrZ626
23bb6ac486 对战传输的玩家配置信息格式简化和修复一个问题(未使用所以从未触发) 2021-04-10 22:24:38 +08:00
MrZ626
7da178c5ec 减少联网玩家传输的设置项 2021-04-10 22:14:19 +08:00
MrZ626
1fe9d2598b 联网推进(修复尝试保存用户信息时错误) 2021-04-10 21:07:26 +08:00
MrZ626
9f56948f47 移除进入已经开始游戏的房间时弹出的提示 2021-04-10 18:33:42 +08:00
28 changed files with 173 additions and 137 deletions

View File

@@ -151,7 +151,6 @@ while true do--Running
--Receive data --Receive data
local s,_,p=SOCK:receive(length) local s,_,p=SOCK:receive(length)
if s then if s then
]]..(debug==1 and""or"--")..[[print(("%s[%d]:%s"):format(threadName,length,s))
res=s res=s
elseif p then--UNF head elseif p then--UNF head
]]..(debug==1 and""or"--")..[[print(("%s[%d/%d]:%s"):format(threadName,#p,length,p)) ]]..(debug==1 and""or"--")..[[print(("%s[%d/%d]:%s"):format(threadName,#p,length,p))

View File

@@ -848,7 +848,6 @@ function textBox:push(t)
if self.scrollPos==#self.texts-1 then if self.scrollPos==#self.texts-1 then
self.scrollPos=#self.texts self.scrollPos=#self.texts
else else
SFX.play("spin_0",.6)
self.new=true self.new=true
end end
end end

View File

@@ -1,7 +1,7 @@
VERSION={ VERSION={
code=1401, code=1403,
string="Alpha V0.14.1", string="Alpha V0.14.3",
name="黎明 Dawn", name="曙光 Morning Twilight",
} }
function love.conf(t) function love.conf(t)
t.identity="Techmino"--Saving folder t.identity="Techmino"--Saving folder

View File

@@ -661,16 +661,21 @@ do--function dumpBasicConfig()
"skin","face", "skin","face",
--Graphic --Graphic
"block","ghost","center","smooth","grid","bagLine", "block","ghost","center","bagLine",
"lockFX","dropFX","moveFX","clearFX","splashFX","shakeFX","atkFX", "dropFX","moveFX","shakeFX",
"text","score","warn","highCam","nextPos", "text","highCam","nextPos",
--Unnecessary graphic
-- "grid","smooth",
-- "lockFX","clearFX","splashFX","atkFX",
-- "score",
} }
function dumpBasicConfig() function dumpBasicConfig()
local S={} local S={}
for _,key in next,gameSetting do for _,key in next,gameSetting do
S[key]=SETTING[key] S[key]=SETTING[key]
end end
return data.encode("string","base64",JSON.encode(S)) return JSON.encode(S)
end end
end end
do--function resetGameData(args) do--function resetGameData(args)

View File

@@ -148,7 +148,7 @@ return{
{"Techmino", {"Techmino",
"techmino", "techmino",
"game", "game",
"*Windows, MacOS, Android | Single player*\nA game with many modes and loads of customization. Low input delay, decent controls.", "*Windows, MacOS, Android | Single player and multiplyer*\nA game with many modes and loads of customization. Low input delay, decent controls.",
}, },
{"Cultris II", {"Cultris II",
"c2 cultris2 cultrisii", "c2 cultris2 cultrisii",

View File

@@ -153,7 +153,7 @@ return{
{"Techmino", {"Techmino",
"techmino tieke", "techmino tieke",
"game", "game",
"一个win/android/linux/macOS方块只有单机,但是模式和各种设置都很齐全,适合有一定基础的新人,输入延迟很小,手感很好", "一个win/android/linux/macOS方块单机模式和各种设置都很齐全,联机正在逐渐开发中,输入延迟很小,手感很好",
}, },
{"Cultris II", {"Cultris II",
"c2 cultris2 cultrisii", "c2 cultris2 cultrisii",
@@ -603,7 +603,7 @@ return{
{"输入延迟", {"输入延迟",
"输入延迟 input delay", "输入延迟 input delay",
"term", "term",
"用任何设备玩任何游戏时,所有的操作(按键盘,点鼠标等)都会晚一点点(很短,几毫秒到几十毫秒)才达游戏如果过长就会很影响游戏手感作用效果类似于你拿qq远程控制打fps游戏\ntop、te等游戏比较明显\n这个延迟一般由硬件性能,硬件状态影响,通常来说不可设置,开启性能模式(或者关闭节能模式)可能会好一点", "用任何设备玩任何游戏时,所有的操作(按键盘,点鼠标等)都会晚一点点(很短,几毫秒到几十毫秒)才达游戏如果过长就会很影响游戏手感作用效果类似于你拿qq远程控制打fps游戏\ntop、te等游戏比较明显\n这个延迟一般由硬件性能,硬件状态影响,通常来说不可设置,开启性能模式(或者关闭节能模式)可能会好一点",
}, },
{"Cold Clear", {"Cold Clear",
"cc coldclear", "cc coldclear",

View File

@@ -601,6 +601,7 @@ return{
email="Email Address", email="Email Address",
password="Password", password="Password",
password2="Re-enter Password", password2="Re-enter Password",
register="Register",
}, },
account={ account={
title="Account", title="Account",

View File

@@ -512,6 +512,7 @@ return{
email="E-mail", email="E-mail",
password="Mot de passe", password="Mot de passe",
password2="Confirmer le mot de passe", password2="Confirmer le mot de passe",
register="Enregistrement",
}, },
account={ account={
title="Compte", title="Compte",

View File

@@ -595,11 +595,12 @@ return{
}, },
register={ register={
title="Registrar", title="Registrar",
login="Registrar", login="Log in",
username="Nome De Usuário", username="Nome De Usuário",
email="Endereço De Email", email="Endereço De Email",
password="Senha", password="Senha",
password2="Entre Senha Novamente", password2="Entre Senha Novamente",
register="Registrar",
}, },
account={ account={
title="Conta", title="Conta",

View File

@@ -515,6 +515,7 @@ return{
email="Correo Elec.", email="Correo Elec.",
password="Contraseña", password="Contraseña",
password2="Repetir Contr.", password2="Repetir Contr.",
register="Registrarse",
}, },
account={ account={
title="Cuenta", title="Cuenta",

View File

@@ -444,6 +444,7 @@ return{
email="@", email="@",
password="*", password="*",
password2="*", password2="*",
register="Sign up",
}, },
account={ account={
title="@_@", title="@_@",

View File

@@ -113,7 +113,7 @@ return{
qq="QQ对线", qq="QQ对线",
}, },
register={ register={
password2="觉得应该填啥", password2="该填啥",
}, },
sound={ sound={
title="音效室", title="音效室",

View File

@@ -599,6 +599,7 @@ return{
email="邮箱", email="邮箱",
password="密码", password="密码",
password2="确认密码", password2="确认密码",
register="注册",
}, },
account={ account={
title="账户", title="账户",

View File

@@ -69,6 +69,6 @@ back to back(B2B)点数说明:
打"X"的格子不允许有方块; 打"X"的格子不允许有方块;
空的格子可以是任何状态; 空的格子可以是任何状态;
普通的七种彩色方块必须颜色对应; 普通的七种彩色方块必须颜色对应;
垃圾行方块的为止只要有方块就可以,但是不能是空气. 垃圾行方块的位置只要有方块就可以,但是不能是空气.
玩家拼出画的图后就会判定胜利. 玩家拼出画的图后就会判定胜利.
]=],"\n") ]=],"\n")

View File

@@ -8,9 +8,6 @@ return{
drop=60,wait=8,fall=20, drop=60,wait=8,fall=20,
task=function(P)P.modeData.target=10 end, task=function(P)P.modeData.target=10 end,
dropPiece=function(P) dropPiece=function(P)
if P.stat.row<180 then
P.stat.row=180
end
if P.stat.row>=P.modeData.target then if P.stat.row>=P.modeData.target then
if P.modeData.target==200 then if P.modeData.target==200 then
P:win("finish") P:win("finish")

View File

@@ -121,11 +121,23 @@ function NET.wsclose_stream()
end end
--Account --Account
function NET.register(username,email,password)
if NET.lock("register")then
WS.send("app",JSON.encode{
action=2,
data={
username=username,
email=email,
password=password,
}
})
end
end
function NET.pong(wsName,message) function NET.pong(wsName,message)
WS.send(wsName,message,"pong") WS.send(wsName,message,"pong")
end end
function NET.getAccessToken() function NET.getAccessToken()
if NET.lock("accessToken",3)then if NET.lock("access_and_login",10)then
WS.send("user",JSON.encode{action=0}) WS.send("user",JSON.encode{action=0})
end end
end end
@@ -138,21 +150,20 @@ function NET.getUserInfo(id,ifDetail)
}, },
}) })
end end
function NET.storeUserInfo(res) function NET.storeUserInfo(d)
local user=USERS[res.uid] local user=USERS[d.uid]
if not user then if not user then
user={} user={}
USERS[res.uid]=user USERS[d.uid]=user
end end
user.uid=res.uid user.uid=d.uid
user.email=res.email user.username=d.username
user.username=res.username user.motto=d.motto
user.motto=res.motto user.avatar=d.avatar
user.avatar=res.avatar
--Get own name --Get own name
if res.uid==USER.uid then if d.uid==USER.uid then
USER.username=res.username USER.username=d.username
FILE.save(USER,"conf/user","q") FILE.save(USER,"conf/user","q")
end end
@@ -173,7 +184,7 @@ function NET.fetchRoom()
end end
end end
function NET.createRoom(roomType,name) function NET.createRoom(roomType,name)
if NET.lock("enterRoom",3)then if NET.lock("enterRoom",1.26)then
WS.send("play",JSON.encode{ WS.send("play",JSON.encode{
action=1, action=1,
data={ data={
@@ -186,7 +197,7 @@ function NET.createRoom(roomType,name)
end end
end end
function NET.enterRoom(roomID,password) function NET.enterRoom(roomID,password)
if NET.lock("enterRoom",3)then if NET.lock("enterRoom",1.26)then
NET.rid=roomID NET.rid=roomID
WS.send("play",JSON.encode{ WS.send("play",JSON.encode{
action=2, action=2,
@@ -246,12 +257,27 @@ function NET.updateWS_app()
else else
local res=_parse(message) local res=_parse(message)
if res then if res then
NET.connected=true if res.type=="Connect"then
NET.allow_online=VERSION.code>=res.lowest NET.connected=true
if VERSION.code<res.newestCode then if VERSION.code>=res.lowest then
LOG.print(text.oldVersion:gsub("$1",res.newestName),180,COLOR.sky) NET.allow_online=true
if USER.authToken then
NET.wsconn_user_token(USER.uid,USER.authToken)
end
end
if VERSION.code<res.newestCode then
LOG.print(text.oldVersion:gsub("$1",res.newestName),180,COLOR.sky)
end
LOG.print(res.notice,300,COLOR.sky)
elseif res.action==0 then--Get new version info
--?
elseif res.action==1 then--Get notice
--?
elseif res.action==2 then--Register
LOG.print(res.data.message,300,COLOR.sky)
if SCN.cur=="register"then SCN.back()end
NET.unlock("register")
end end
LOG.print(res.notice,300,COLOR.sky)
else else
WS.alert("app") WS.alert("app")
end end
@@ -285,8 +311,6 @@ function NET.updateWS_user()
if res.uid then if res.uid then
USER.uid=res.uid USER.uid=res.uid
USER.authToken=res.authToken USER.authToken=res.authToken
WIDGET.active.email:clear()
WIDGET.active.password:clear()
FILE.save(USER,"conf/user","q") FILE.save(USER,"conf/user","q")
SCN.back() SCN.back()
end end
@@ -299,9 +323,8 @@ function NET.updateWS_user()
NET.accessToken=res.accessToken NET.accessToken=res.accessToken
LOG.print(text.accessSuccessed) LOG.print(text.accessSuccessed)
NET.wsconn_play() NET.wsconn_play()
NET.unlock("accessToken")
elseif res.action==1 then--Get userInfo elseif res.action==1 then--Get userInfo
NET.storeUserInfo(res) NET.storeUserInfo(res.data)
end end
else else
WS.alert("user") WS.alert("user")
@@ -331,6 +354,7 @@ function NET.updateWS_play()
if res.type=="Connect"then if res.type=="Connect"then
SCN.go("net_menu") SCN.go("net_menu")
NET.unlock("wsc_play") NET.unlock("wsc_play")
NET.unlock("access_and_login")
elseif res.action==0 then--Fetch rooms elseif res.action==0 then--Fetch rooms
NET.roomList=res.roomList NET.roomList=res.roomList
NET.unlock("fetchRoom") NET.unlock("fetchRoom")
@@ -347,12 +371,11 @@ function NET.updateWS_play()
username=p.username, username=p.username,
sid=p.sid, sid=p.sid,
ready=p.ready, ready=p.ready,
conf=p.config, config=p.config,
}) })
end end
end end
loadGame("netBattle",true,true) loadGame("netBattle",true,true)
NET.unlock("enterRoom")
else else
--Load other players --Load other players
ins(PLY_NET,{ ins(PLY_NET,{
@@ -360,9 +383,9 @@ function NET.updateWS_play()
username=d.username, username=d.username,
sid=d.sid, sid=d.sid,
ready=d.ready, ready=d.ready,
conf=d.config, config=d.config,
}) })
SCN.socketRead("Join",res.data) SCN.socketRead("Join",d)
end end
elseif res.action==3 then--Player leave elseif res.action==3 then--Player leave
if not d.uid then if not d.uid then
@@ -388,15 +411,15 @@ function NET.updateWS_play()
break break
end end
end end
SCN.socketRead("Leave",res.data) SCN.socketRead("Leave",d)
end end
elseif res.action==4 then--Player talk elseif res.action==4 then--Player talk
SCN.socketRead("Talk",res.data) SCN.socketRead("Talk",d)
elseif res.action==5 then--Player change settings elseif res.action==5 then--Player change settings
if tostring(USER.uid)~=d.uid then if tostring(USER.uid)~=d.uid then
for i=1,#PLY_NET do for i=1,#PLY_NET do
if PLY_NET[i].uid==d.uid then if PLY_NET[i].uid==d.uid then
PLY_NET[i].conf=d.config PLY_NET[i].config=d.config
PLY_NET[i].p:setConf(d.config) PLY_NET[i].p:setConf(d.config)
return return
end end
@@ -404,27 +427,34 @@ function NET.updateWS_play()
resetGameData("qn") resetGameData("qn")
end end
elseif res.action==6 then--One ready elseif res.action==6 then--One ready
for i=1,#PLY_NET do for i,p in next,PLY_NET do
if PLY_NET[i].uid==d.uid then if p.uid==d.uid then
if PLY_NET[i].ready~=d.ready then if p.ready~=d.ready then
p.ready=d.ready
SFX.play("spin_0",.6)
if i==1 then if i==1 then
WIDGET.active.ready.color=COLOR[d.ready and"lY"or"lG"] NET.unlock("ready")
else
for j=2,#PLY_NET do
if not PLY_NET[j].ready then
break
elseif j==#PLY_NET then
SFX.play("warning",.5)
end
end
end end
PLY_NET[i].ready=d.ready
SFX.play("reach",.6)
end end
break break
end end
end end
NET.unlock("ready")
elseif res.action==7 then--Ready elseif res.action==7 then--Ready
--? SFX.play("reach",.6)
elseif res.action==8 then--Set elseif res.action==8 then--Set
NET.rsid=d.rid NET.rsid=d.rid
NET.wsconn_stream() NET.wsconn_stream()
TASK.new(NET.updateWS_stream) TASK.new(NET.updateWS_stream)
elseif res.action==9 then--Game finished elseif res.action==9 then--Game finished
SCN.socketRead("Finish",res.data) SCN.socketRead("Finish",d)
NET.wsclose_stream() NET.wsclose_stream()
end end
else else
@@ -451,10 +481,11 @@ function NET.updateWS_stream()
else else
local res=_parse(message) local res=_parse(message)
if res then if res then
local d=res.data
if res.type=="Connect"then if res.type=="Connect"then
NET.unlock("wsc_stream") NET.unlock("wsc_stream")
elseif res.action==0 then--Game start elseif res.action==0 then--Game start
SCN.socketRead("Go",res.data) SCN.socketRead("Go",d)
elseif res.action==1 then--Game finished elseif res.action==1 then--Game finished
--? --?
elseif res.action==2 then--Player join elseif res.action==2 then--Player join
@@ -464,7 +495,7 @@ function NET.updateWS_stream()
elseif res.action==4 then--Player died elseif res.action==4 then--Player died
--? --?
elseif res.action==5 then--Receive stream elseif res.action==5 then--Receive stream
SCN.socketRead("Stream",res.data) SCN.socketRead("Stream",d)
end end
else else
WS.alert("stream") WS.alert("stream")

View File

@@ -498,7 +498,7 @@ return{
color=C.dSky, color=C.dSky,
}, },
{ {
name="George2503", name="George2003",
font=25, font=25,
color=C.grey, color=C.grey,
}, },
@@ -507,4 +507,9 @@ return{
font=25, font=25,
color=C.grey, color=C.grey,
}, },
{
name="T7887库德里尔",
font=25,
color=C.grey,
},
} }

View File

@@ -234,11 +234,9 @@ local function loadGameEnv(P)--Load gameEnv
end end
end end
local function loadRemoteEnv(P,confStr)--Load gameEnv local function loadRemoteEnv(P,confStr)--Load gameEnv
local _,conf=pcall(love.data.decode,"string","base64",confStr) confStr=JSON.decode(confStr)
if _ then if not confStr then
conf=JSON.decode(conf) confStr={}
else
conf={}
LOG.print("Bad conf from "..P.username.."#"..P.uid) LOG.print("Bad conf from "..P.username.."#"..P.uid)
end end
@@ -249,8 +247,8 @@ local function loadRemoteEnv(P,confStr)--Load gameEnv
for k,v in next,gameEnv0 do for k,v in next,gameEnv0 do
if GAME.modeEnv[k]~=nil then if GAME.modeEnv[k]~=nil then
v=GAME.modeEnv[k] --Mode setting v=GAME.modeEnv[k] --Mode setting
elseif conf[k]~=nil then elseif confStr[k]~=nil then
v=conf[k] --Game setting v=confStr[k] --Game setting
elseif SETTING[k]~=nil then elseif SETTING[k]~=nil then
v=SETTING[k] --Global setting v=SETTING[k] --Global setting
end end
@@ -332,6 +330,7 @@ local function applyGameEnv(P)--Finish gameEnv processing
if ENV.clearFX==0 then ENV.clearFX=false end if ENV.clearFX==0 then ENV.clearFX=false end
if ENV.splashFX==0 then ENV.splashFX=false end if ENV.splashFX==0 then ENV.splashFX=false end
if ENV.shakeFX==0 then ENV.shakeFX=false end if ENV.shakeFX==0 then ENV.shakeFX=false end
if ENV.atkFX==0 then ENV.atkFX=false end
end end
if ENV.ghost==0 then ENV.ghost=false end if ENV.ghost==0 then ENV.ghost=false end
if ENV.center==0 then ENV.center=false end if ENV.center==0 then ENV.center=false end
@@ -385,7 +384,7 @@ function PLY.newRemotePlayer(id,mini,data)
P.uid=data.uid P.uid=data.uid
P.username=data.username P.username=data.username
P.sid=data.sid P.sid=data.sid
loadRemoteEnv(P,data.conf) loadRemoteEnv(P,data.config)
applyGameEnv(P) applyGameEnv(P)
end end

View File

@@ -97,7 +97,7 @@ end
function Player:createClearingFX(y,spd) function Player:createClearingFX(y,spd)
ins(self.clearFX,{y,0,spd}) ins(self.clearFX,{y,0,spd})
end end
function Player:createBeam(R,send,color) function Player:createBeam(R,send,power,color)
local x1,y1,x2,y2 local x1,y1,x2,y2
if self.mini then x1,y1=self.centerX,self.centerY if self.mini then x1,y1=self.centerX,self.centerY
else x1,y1=self.x+(30*(self.curX+self.cur.sc[2])-30+15+150)*self.size,self.y+(600-30*(self.curY+self.cur.sc[1])+15)*self.size else x1,y1=self.x+(30*(self.curX+self.cur.sc[2])-30+15+150)*self.size,self.y+(600-30*(self.curY+self.cur.sc[1])+15)*self.size
@@ -110,7 +110,7 @@ function Player:createBeam(R,send,color)
local r,g,b=c[1]*2,c[2]*2,c[3]*2 local r,g,b=c[1]*2,c[2]*2,c[3]*2
local a=GAME.modeEnv.royaleMode and not(self.type=="human"or R.type=="human")and .2 or 1 local a=GAME.modeEnv.royaleMode and not(self.type=="human"or R.type=="human")and .2 or 1
SYSFX.newAttack(1-SETTING.atkFX*.1,x1,y1,x2,y2,int(send^.7*(4+SETTING.atkFX)),r,g,b,a*(SETTING.atkFX+2)*.0626) SYSFX.newAttack(1-power*.1,x1,y1,x2,y2,int(send^.7*(4+power)),r,g,b,a*(power+2)*.0626)
end end
--------------------------</FX>-------------------------- --------------------------</FX>--------------------------
@@ -214,9 +214,9 @@ function Player:setRS(RSname)
end end
function Player:setConf(confStr) function Player:setConf(confStr)
local _,conf=pcall(love.data.decode,"string","base64",confStr) confStr=JSON.decode(confStr)
if _ then if confStr then
for k,v in next,conf do for k,v in next,confStr do
if not GAME.modeEnv[k]then if not GAME.modeEnv[k]then
self.gameEnv[k]=v self.gameEnv[k]=v
end end
@@ -1322,8 +1322,8 @@ do--Player.drop(self)--Place piece
if M>0 then if M>0 then
for i=1,M do for i=1,M do
self:attack(self.atker[i],send,sendTime,generateLine(self:RND(10))) self:attack(self.atker[i],send,sendTime,generateLine(self:RND(10)))
if SETTING.atkFX>0 then if ENV.atkFX then
self:createBeam(self.atker[i],send,C.color) self:createBeam(self.atker[i],send,ENV.atkFX,C.color)
end end
end end
else else
@@ -1338,8 +1338,8 @@ do--Player.drop(self)--Place piece
end end
if T then if T then
self:attack(T,send,sendTime,generateLine(self:RND(10))) self:attack(T,send,sendTime,generateLine(self:RND(10)))
if SETTING.atkFX>0 then if ENV.atkFX then
self:createBeam(T,send,C.color) self:createBeam(T,send,ENV.atkFX,C.color)
end end
end end
end end

View File

@@ -373,13 +373,13 @@ function update.dead(P,dt)
end end
function update.remote_alive(P,dt) function update.remote_alive(P,dt)
local frmStep=GAME.frame-P.stat.frame local frmStep=GAME.frame-P.stat.frame
frmStep= for _=1,
frmStep<20 and 1 or frmStep<20 and 1 or
frmStep<45 and rnd(2)or frmStep<45 and rnd(2)or
frmStep<90 and 2 or frmStep<90 and 2 or
frmStep<180 and rnd(2,3) or frmStep<180 and rnd(2,3) or
3 3
repeat do
local eventTime=P.stream[P.streamProgress] local eventTime=P.stream[P.streamProgress]
if eventTime then--Normal state, event forward if eventTime then--Normal state, event forward
if P.stat.frame==eventTime then--Event time, execute action, read next so don't update immediately if P.stat.frame==eventTime then--Event time, execute action, read next so don't update immediately
@@ -394,23 +394,21 @@ function update.remote_alive(P,dt)
local amount=int(event/0x100)%0x100 local amount=int(event/0x100)%0x100
local time=int(event/0x10000)%0x10000 local time=int(event/0x10000)%0x10000
local line=int(event/0x100000000)%0x10000 local line=int(event/0x100000000)%0x10000
local L=PLY_ALIVE for _,p in next,PLY_ALIVE do
for i=1,#L do if p.sid==sid then
if L[i].sid==sid then P:attack(p,amount,time,line,true)
P:attack(L[i],amount,time,line,true) if P.gameEnv.atkFX then
if SETTING.atkFX>0 then P:createBeam(p,amount,P.gameEnv.atkFX,P.cur.color)
P:createBeam(L[i],amount,P.cur.color)
end end
break break
end end
end end
elseif event>0x1000000000000 then--Receiving lines elseif event>0x1000000000000 then--Receiving lines
local L=PLY_ALIVE
local sid=event%0x100 local sid=event%0x100
for i=1,#L do for _,p in next,PLY_ALIVE do
if L[i].sid==sid then if p.sid==sid then
P:receive( P:receive(
L[i], p,
int(event/0x100)%0x100,--amount int(event/0x100)%0x100,--amount
int(event/0x10000)%0x10000,--time int(event/0x10000)%0x10000,--time
int(event/0x100000000)%0x10000--line int(event/0x100000000)%0x10000--line
@@ -422,11 +420,10 @@ function update.remote_alive(P,dt)
P.streamProgress=P.streamProgress+2 P.streamProgress=P.streamProgress+2
else--No event now, run one frame else--No event now, run one frame
update.alive(P,dt) update.alive(P,dt)
frmStep=frmStep-1
end end
else--Pause state, no actions, quit loop else--Pause state, no actions, quit loop
break break
end end
until frmStep<=0 end
end end
return update return update

View File

@@ -1,13 +1,8 @@
local scene={} local scene={}
local inited
function scene.sceneInit() function scene.sceneInit()
BG.set("cubes") BG.set("cubes")
if not inited then WIDGET.active.texts:setTexts(require"parts.updateLog")
inited=true
WIDGET.active.texts:setTexts(require"parts.updateLog")
end
if newVersionLaunch then if newVersionLaunch then
newVersionLaunch=false newVersionLaunch=false
end end

View File

@@ -181,9 +181,6 @@ local loadingThread=coroutine.wrap(function()
TASK.new(NET.updateWS_user) TASK.new(NET.updateWS_user)
TASK.new(NET.updateWS_play) TASK.new(NET.updateWS_play)
NET.wsconn_app() NET.wsconn_app()
if USER.authToken then
NET.wsconn_user_token(USER.uid,USER.authToken)
end
while true do while true do
if math.random()<.126 then if math.random()<.126 then

View File

@@ -13,7 +13,7 @@ local scene={}
scene.widgetList={ scene.widgetList={
WIDGET.newText{name="title", x=80, y=50,font=70,align="L"}, WIDGET.newText{name="title", x=80, y=50,font=70,align="L"},
-- WIDGET.newButton{name="register",x=1140, y=100,w=170,h=80,color="green",code=function()SCN.swapTo("register","swipeR")end}, WIDGET.newButton{name="register", x=1140, y=100,w=170,h=80,color="lY",code=function()SCN.swapTo("register","swipeR")end},
WIDGET.newInputBox{name="email", x=380, y=200,w=500,h=60,regex="[0-9A-Za-z@._-]"}, WIDGET.newInputBox{name="email", x=380, y=200,w=500,h=60,regex="[0-9A-Za-z@._-]"},
WIDGET.newInputBox{name="password", x=380, y=300,w=626,h=60,secret=true,regex="[ -~]"}, WIDGET.newInputBox{name="password", x=380, y=300,w=626,h=60,secret=true,regex="[ -~]"},
WIDGET.newKey{name="login", x=1140, y=540,w=170,h=80,font=40,code=login}, WIDGET.newKey{name="login", x=1140, y=540,w=170,h=80,font=40,code=login},

View File

@@ -248,8 +248,8 @@ function scene.draw()
--Rectangle --Rectangle
gc.setColor(COLOR[p.ready and"G"or"white"]) gc.setColor(COLOR[p.ready and"G"or"white"])
gc.setLineWidth(4) gc.setLineWidth(3)
gc.rectangle("line",40,67+50*i,1200,42) gc.rectangle("line",40,67+50*i,800,42)
--Username --Username
gc.setColor(1,1,1) gc.setColor(1,1,1)
@@ -270,7 +270,7 @@ function scene.draw()
end end
scene.widgetList={ scene.widgetList={
textBox, textBox,
WIDGET.newKey{name="ready",x=900,y=560,w=400,h=100,color="lG",font=40,code=pressKey"space",hide=function() WIDGET.newKey{name="ready",x=900,y=560,w=400,h=100,color="lB",font=40,code=pressKey"space",hide=function()
return return
playing or playing or
not textBox.hide or not textBox.hide or

View File

@@ -67,9 +67,6 @@ function scene.keyDown(k)
LOG.print("Can't enter private room now") LOG.print("Can't enter private room now")
return return
end end
if NET.roomList[selected].start then
LOG.print("Can't enter room after start")
end
NET.enterRoom(NET.roomList[selected].rid)--,password NET.enterRoom(NET.roomList[selected].rid)--,password
end end
end end

View File

@@ -1,41 +1,30 @@
local scene={} local scene={}
function scene.keyDown(key) local function register()
if key=="return"then local username= WIDGET.active.username.value
local username= WIDGET.active.username.value local email= WIDGET.active.email.value
local email= WIDGET.active.email.value local password= WIDGET.active.password.value
local password= WIDGET.active.password.value local password2=WIDGET.active.password2.value
local password2=WIDGET.active.password2.value if #username==0 then
if #username==0 then LOG.print(text.noUsername)return
LOG.print(text.noUsername)return elseif not email:match("^[a-zA-Z0-9_]+@[a-zA-Z0-9_-]+%.[a-zA-Z0-9_]+$")then
elseif not email:match("^[a-zA-Z0-9_]+@[a-zA-Z0-9_-]+%.[a-zA-Z0-9_]+$")then LOG.print(text.wrongEmail)return
LOG.print(text.wrongEmail)return elseif #password==0 or #password2==0 then
elseif #password==0 or #password2==0 then LOG.print(text.noPassword)return
LOG.print(text.noPassword)return elseif password~=password2 then
elseif password~=password2 then LOG.print(text.diffPassword)return
LOG.print(text.diffPassword)return
end
--[[
JSON.encode{
username=username,
email=email,
password=password,
}
]]
elseif key=="escape"then
SCN.back()
else
WIDGET.keyPressed(key)
end end
NET.register(username,email,password)
end end
scene.widgetList={ scene.widgetList={
WIDGET.newText{name="title", x=80, y=50,font=70,align="L"}, WIDGET.newText{name="title", x=80, y=50,font=70,align="L"},
WIDGET.newButton{name="login", x=1140, y=100,w=170,h=80,color="green",code=function()SCN.swapTo("login","swipeL")end}, WIDGET.newButton{name="login", x=1140, y=100,w=170,h=80,color="lY",code=function()SCN.swapTo("login","swipeL")end},
WIDGET.newInputBox{name="username", x=380, y=200,w=500,h=60,regex="[0-9A-Za-z_]"}, WIDGET.newInputBox{name="username", x=380, y=200,w=500,h=60,regex="[0-9A-Za-z_]"},
WIDGET.newInputBox{name="email", x=380, y=300,w=626,h=60,regex="[0-9A-Za-z@._-]"}, WIDGET.newInputBox{name="email", x=380, y=300,w=626,h=60,regex="[0-9A-Za-z@._-]"},
WIDGET.newInputBox{name="password", x=380, y=400,w=626,h=60,secret=true,regex="[ -~]"}, WIDGET.newInputBox{name="password", x=380, y=400,w=626,h=60,secret=true,regex="[ -~]"},
WIDGET.newInputBox{name="password2", x=380, y=500,w=626,h=60,secret=true,regex="[ -~]"}, WIDGET.newInputBox{name="password2",x=380, y=500,w=626,h=60,secret=true,regex="[ -~]"},
WIDGET.newKey{name="register", x=1140, y=540,w=170,h=80,font=40,code=register},
WIDGET.newButton{name="back", x=1140, y=640,w=170,h=80,font=40,code=backScene}, WIDGET.newButton{name="back", x=1140, y=640,w=170,h=80,font=40,code=backScene},
} }

View File

@@ -48,7 +48,7 @@ function scene.touchClick(x,y)
end end
function scene.touchDown(x,y) function scene.touchDown(x,y)
SYSFX.newRipple(.5,x,y,50) SYSFX.newRipple(.5,x,y,50)
push(("[touchDown] <%d: %d, %d>"):format(x,y)) push(("[touchDown] <%d, %d>"):format(x,y))
end end
function scene.touchMove(x,y) function scene.touchMove(x,y)
SYSFX.newRipple(.5,x,y,50) SYSFX.newRipple(.5,x,y,50)

View File

@@ -22,7 +22,27 @@ return SPLITSTR([=[
可选虚拟按键颜色; 工程编译到字节码; task-Z(新AI) 可选虚拟按键颜色; 工程编译到字节码; task-Z(新AI)
录像回放菜单; 跳帧开关; 教学关; 超60帧; 热更新 录像回放菜单; 跳帧开关; 教学关; 超60帧; 热更新
0.14.1: 黎明 Dawn 0.14.3: 曙光 Morning Twilight
改动:
尝试进联网菜单的两步都完成前再次点击按钮无效
自动登录时机修改为ws-app连接成功并且版本是最新
微调玩家准备相关的交互
进房固定1.26秒cd
文本框控件不再有新消息提示音
修复:
修复test场景触屏点击报错
0.14.2: 破晓 Dawn
新增:
重新启用注册菜单
改动:
优化一些联网对战相关内容
攻击特效从全局改为玩家设置项一部分
修复:
一些联网对战问题
马拉松模式忘了删测试用代码
0.14.1: 拂晓 Daybreak
改动: 改动:
为了更好的游戏体验,手机只能开单挑房,电脑开多人房(不建议),特殊用户可以开更大的房 为了更好的游戏体验,手机只能开单挑房,电脑开多人房(不建议),特殊用户可以开更大的房
增加联网对战模式的垃圾行上涨速度 增加联网对战模式的垃圾行上涨速度