Compare commits

...

124 Commits

Author SHA1 Message Date
MrZ626
5a8bb432fe 0.12.3: 矩形 2020-12-14 23:26:22 +08:00
MrZ626
89bde6e6a1 修复溅射特效位置偏移 2020-12-14 23:26:22 +08:00
MrZ626
521dea8c0e 补充画面设置丢失的文字 2020-12-14 23:26:22 +08:00
MrZ626
eefd6af5a4 消除方块运动路径微调 2020-12-14 23:26:22 +08:00
MrZ626
e6cdb8dbb1 登录界面文本修正 2020-12-14 23:26:22 +08:00
Particle_G
114c348039 enable thread lib 2020-12-14 23:26:22 +08:00
Particle_G
ba7168edd4 Change global table "NETWORK" to "ACCOUNT" 2020-12-14 23:26:22 +08:00
Particle_G
9e6e170e49 Save table to file 2020-12-14 23:26:22 +08:00
MrZ626
1eba821522 json库微调 2020-12-14 23:26:22 +08:00
MrZ626
e0c639e145 修复demo玩家出块方向会被设置覆盖 2020-12-14 23:26:22 +08:00
MrZ626
bbc9dcb9e3 优化cubefield的画面和声音 2020-12-14 23:26:22 +08:00
MrZ626
e83159102f 井字棋棋子形状调整 2020-12-14 23:26:22 +08:00
MrZ626
6a2ac1e669 方块溅射特效机制升级,支持更高级的路径 2020-12-14 23:26:22 +08:00
MrZ626
ac76984052 新增方块溅射特效 2020-12-14 23:26:21 +08:00
MrZ626
373fc31408 调整sysFX的使用参数 2020-12-14 23:26:21 +08:00
MrZ626
9fbb248929 微调cubefield的ui 2020-12-14 23:26:21 +08:00
MrZ626
73ec8a51c2 新增小游戏:Cubefield 2020-12-14 23:26:21 +08:00
Particle_G
a2e3301dfd change server ip 2020-12-14 23:26:21 +08:00
Particle_G
b924656abd change "username" textbox in login scene to "email" textbox 2020-12-14 23:26:21 +08:00
Particle_G
8f2b62ccc0 implemented register and login function 2020-12-14 23:26:21 +08:00
MrZ626
9265101025 json库微调 2020-12-14 23:26:21 +08:00
MrZ626
1d2a4437e3 登录和注册页面分离 2020-12-14 23:26:21 +08:00
MrZ626
3116fff552 mod重新整理 2020-12-14 23:26:21 +08:00
MrZ626
8cc53bfb46 优化mod菜单显示 2020-12-14 23:26:21 +08:00
MrZ626
44b151c617 整理代码 2020-12-14 23:26:20 +08:00
MrZ626
914a962a94 增加骨块mod 2020-12-14 23:26:20 +08:00
MrZ626
7649d23ac4 暂停时显示所选mod 2020-12-14 23:26:20 +08:00
MrZ626
467c8f44d6 更改虚拟按键可见性的逻辑,修复mod不会影响虚拟按键的显示 2020-12-14 23:26:20 +08:00
MrZ626
b33cf65593 游戏开始时列出使用了的mod 2020-12-14 23:26:20 +08:00
MrZ626
3b717d4705 调整mod系统交互逻辑 2020-12-14 23:26:20 +08:00
MrZ626
fb5ea1643a 修复CC切换到20G模式报错 2020-12-14 23:26:20 +08:00
MrZ626
fb895f8bd4 修复进过井字棋导致音乐模块损坏 2020-12-14 23:26:20 +08:00
MrZ626
976814e039 整理代码,修复自定义模式用不了mod 2020-12-14 23:26:20 +08:00
MrZ626
2783a7978f PC挑战简单模式允许Ospin 2020-12-14 23:26:20 +08:00
MrZ626
4c0c777874 修复[两个c2踢墙表]的错误 2020-12-14 23:26:20 +08:00
MrZ626
0e9730d923 0.12.2: Mod更新 2020-12-14 23:26:20 +08:00
MrZ626
c3d9531f98 提高pc挑战模式评级要求 2020-12-14 23:26:20 +08:00
MrZ626
92f6826a6c 修复hold保存旋转状态(仅进序列时) 2020-12-14 23:26:20 +08:00
MrZ626
7c52eef041 随机序列的mod改为指定序列,调整一些mod颜色,NT不会成绩无效 2020-12-14 23:26:20 +08:00
MrZ626
73ccc1d7ed mod界面加入重置按钮 2020-12-14 23:26:19 +08:00
MrZ626
d023455f73 真·修复手机点不了mod 2020-12-14 23:26:19 +08:00
MrZ626
e72cd1751a 修复tunnel背景在手机显示错误 2020-12-14 23:26:19 +08:00
MrZ626
9d2a46ab87 整理代码,微调ui 2020-12-14 23:26:19 +08:00
MrZ626
f8c45302f9 自定义游戏添加mod入口 2020-12-14 23:26:19 +08:00
MrZ626
e78dc5d333 demo玩家不使用mod 2020-12-14 23:26:19 +08:00
MrZ626
538c3b90ea 修改四个mod名字 2020-12-14 23:26:19 +08:00
MrZ626
17f0cb2369 调整两个mod的位置 2020-12-14 23:26:19 +08:00
MrZ626
340b2ed8f4 修复重置mod后还会显示成绩无效字样 2020-12-14 23:26:19 +08:00
MrZ626
314e1de5f0 修改mod菜单的文本显示 2020-12-14 23:26:19 +08:00
MrZ626
8544279cb6 增加mod:多hold 2020-12-14 23:26:19 +08:00
MrZ626
95bee07317 触屏可以开关mod 2020-12-14 23:26:19 +08:00
MrZ626
046d173090 mod系统初版(三个mod未完成) 2020-12-14 23:26:19 +08:00
MrZ626
c38ef7c487 文本控件可以淡入淡出 2020-12-14 23:26:19 +08:00
MrZ626
59fbb8106c 多hold开启时cc不会抽风 2020-12-14 23:26:18 +08:00
MrZ626
8a34146028 修正代码格式 2020-12-14 23:26:18 +08:00
MrZ626
c38fd92029 断b2b即死条件改为b2b点数掉到50以下,补充遗漏文本 2020-12-14 23:26:18 +08:00
MrZ626
7e9f56a770 修复井字棋结束后还显示可走区域 2020-12-14 23:26:18 +08:00
MrZ626
3876169ce3 开场动画界面鼠标右键不退出 2020-12-14 23:26:18 +08:00
MrZ626
c91a79488d 添加断b2b即死规则,可在自定义模式打开 2020-12-14 23:26:17 +08:00
MrZ626
aa0f2ccdc6 整理玩家特效相关的生成代码,修复主菜单Demo玩家复活动画坐标不正确 2020-12-14 23:26:17 +08:00
MrZ626
8a9ae47d41 主菜单Demo玩家平滑下落显示 2020-12-14 23:26:17 +08:00
MrZ626
9442da2b44 整理代码,两个远古时期的游戏相关全局变量移入GAME 2020-12-14 23:26:17 +08:00
MrZ626
0456bf515e 简化resetGameData函数 2020-12-14 23:26:17 +08:00
MrZ626
7bfd362567 修复之前重构next和hold系统后ai的不正确行为 2020-12-14 23:26:17 +08:00
MrZ626
25b8098c02 词典微更新 2020-12-14 23:26:17 +08:00
MrZ626
f216e2d6e5 全局变量MODEENV移入全局变量GAME中,重构虚拟按键显示情况代码 2020-12-14 23:26:17 +08:00
MrZ626
1c31015fa8 default_data文件改名globalTables,main中全局table声明统一放到里面 2020-12-14 23:26:17 +08:00
MrZ626
55fc778d38 hold系统再调整 2020-12-14 23:26:17 +08:00
MrZ626
090ca861b9 新增几个多hold相关的tips 2020-12-14 23:26:16 +08:00
MrZ626
f275cc404b 自定义游戏默认打开ospin 2020-12-14 23:26:16 +08:00
MrZ626
22dcf9d84d 音效室字号调小 2020-12-14 23:26:16 +08:00
MrZ626
d167fecf07 微调自定义游戏-高级的ui 2020-12-14 23:26:16 +08:00
MrZ626
c000f5a3a1 修复多hold时hold槽填满有一个错误行为 2020-12-14 23:26:16 +08:00
MrZ626
50193ab149 主循环时序调整,不知道会不会提速 2020-12-14 23:26:16 +08:00
MrZ626
402636f70c 修复小游戏界面没字 2020-12-14 23:26:16 +08:00
MrZ626
340f636ea7 调整ai对多hold的支持 2020-12-14 23:26:16 +08:00
MrZ626
3b8a952c84 模式地图20G路线微调 2020-12-14 23:26:16 +08:00
MrZ626
4a84466ffe 模式规则忘了跟上使用holdCount变量名 2020-12-14 23:26:16 +08:00
MrZ626
feafb79529 自定义模式可以选择多hold,oncehold改名infHold 2020-12-14 23:26:16 +08:00
MrZ626
721fe74eec 整理代码 2020-12-14 23:26:16 +08:00
MrZ626
85c8239116 攻击缓冲区增加到26 2020-12-14 23:26:16 +08:00
MrZ626
6bd0843dd5 整理代码,freshTime改为倒计时,修复hold后锁延刷新次数错误问题 2020-12-14 23:26:16 +08:00
MrZ626
8291184ae6 整理代码 2020-12-14 23:26:16 +08:00
MrZ626
564dd1b20d 只对0.12以前的版本执行删除部分模式记录处理 2020-12-14 23:26:16 +08:00
MrZ626
c6b41c5913 增加五联块极简判定 2020-12-14 23:26:15 +08:00
MrZ626
8ea1b03ab2 两个无尽模式细节调整 2020-12-14 23:26:15 +08:00
MrZ626
e3f2a9c803 重构next和hold系统,支持多next 2020-12-14 23:26:15 +08:00
MrZ626
ccf47c3c2f 降低进攻-极限难度,降低进攻-困难评级要求 2020-12-14 23:26:15 +08:00
MrZ626
24a47f1e1e 整理代码 2020-12-14 23:26:15 +08:00
MrZ626
6a86c2d984 AIRS改名并支持无踢墙180度转,PC练习模式改用此旋转系统 2020-12-14 23:26:15 +08:00
MrZ626
909c265e51 允许选择旋转系统 2020-12-14 23:26:15 +08:00
MrZ626
d70e915557 sysFX模块改名SYSFX 2020-12-14 23:26:14 +08:00
MrZ626
a1f4b703e6 整理代码 2020-12-14 23:26:14 +08:00
MrZ626
538960ac04 模式和语言文件移入parts文件夹 2020-12-14 23:26:14 +08:00
MrZ626
a43a34fe10 多媒体文件整理到media文件夹内 2020-12-14 23:26:14 +08:00
MrZ626
db3c87f852 conf文件预留好安卓用麦克风开关 2020-12-14 23:26:13 +08:00
MrZ626
7cd5d19f31 所有setfont参数统一为5的倍数,节约内存占用 2020-12-14 23:26:13 +08:00
MrZ626
246def7525 整理代码 2020-12-14 23:26:13 +08:00
MrZ626
dda0f04b8d 小游戏场景名统一mg_开头,方便查找 2020-12-14 23:26:13 +08:00
MrZ626
1f45b420cc 把绘制方块贴图的函数local化,略微提升性能 2020-12-14 23:26:13 +08:00
MrZ626
2e6c4c3266 高速经典模式音效微调 2020-12-14 23:26:13 +08:00
MrZ626
890ef6c87b 模块文件名更清晰 2020-12-14 23:26:12 +08:00
MrZ626
025ef02e71 debug模式鼠标单击输出信息升级 2020-12-14 23:26:12 +08:00
MrZ626
b1c15750b4 SCR模块化 2020-12-14 23:26:12 +08:00
MrZ626
f1f2eb583f SHADER模块整理,初始化代码移至main 2020-12-14 23:26:12 +08:00
MrZ626
ba486b5de7 A to Z小游戏更难作弊 2020-12-14 23:26:12 +08:00
MrZ626
c96b1f6106 控件系统更强大,自定义序列支持tab切换模式 2020-12-14 23:26:12 +08:00
MrZ626
b5af572d93 修复音量设置界面BGM滑条有细微延迟 2020-12-14 23:26:12 +08:00
MrZ626
fe632b71d6 修复井字棋在平局结束游戏时不结算 2020-12-14 23:26:12 +08:00
MrZ626
234ee0c4d1 新增BGM:sugar fairy,修改newera文件名,三个音频模块的加载表移至模块外 2020-12-14 23:26:12 +08:00
MrZ626
1fb50e3f4e 修复音效室Zspin按钮没声音 2020-12-14 23:26:12 +08:00
MrZ626
f478184342 修复部分旋转系统旋转O后锁定就报错 2020-12-14 23:26:12 +08:00
MrZ626
c29a1e4c0d 新增小游戏:战略井字棋 2020-12-14 23:26:12 +08:00
MrZ626
aed9fb8a24 可变旋转系统准备工作完成 2020-12-14 23:26:12 +08:00
MrZ_26
f9bdd8433a Merge pull request #3 from MattMayuga/master
Update lang_en.lua
2020-12-14 23:26:11 +08:00
MrZ626
0b8de7f94a 降低两个PC练习模式的评级标准 2020-12-14 23:26:11 +08:00
MrZ626
e995d93bb2 赞助名单更新 2020-12-14 23:26:11 +08:00
MrZ626
379a6cd511 0.12.1:漏洞修复 2020-12-14 23:26:11 +08:00
MrZ626
1a9c7ad9de 自定义默认开启 2020-12-14 23:26:11 +08:00
MrZ626
1aade88bd9 手机可以玩AtoZ了 2020-12-14 23:26:11 +08:00
MrZ626
ae71968909 两个C2踢墙表调整 2020-12-14 23:26:11 +08:00
MrZ626
b8f22dc99d 修复加载不了CC的手机主界面ai报错 2020-12-14 23:26:11 +08:00
MrZ626
0e08632bf9 修复c4w模式爆炸 2020-12-14 23:26:11 +08:00
Mizu
eaa43442db Update French 2020-12-14 23:26:11 +08:00
464 changed files with 3924 additions and 2358 deletions

View File

@@ -22,34 +22,13 @@ local BGM={
--suspend=[str:pausing ID] --suspend=[str:pausing ID]
--playing=[src:playing SRC] --playing=[src:playing SRC]
} }
BGM.list={ function BGM.set(L)
"blank",--menu BGM.list=L
"race",--sprint, solo BGM.len=#L
"infinite",--infinite norm/dig, ultra, zen, tech-finesse end
"push",--marathon, round, tsd, blind-5/6
"way",--dig sprint
"reason",--drought, blind-1/2/3/4
"secret8th",--master-1, survivor-2
"secret7th",--master-2, survivor-3
"waterfall",--sprint Penta/MPH
"newera",--bigbang, survivor-1, tech-normal
"oxygen",--c4w/pc train
"truth",--pc challenge
"distortion",--master-3
"far",--GM
"shining terminal",--attacker
"storm",--defender, survivor-4/5
"down",--dig, tech-hard/lunatic
"rockblock",--classic, 49/99
"cruelty","final","8-bit happiness","end","how feeling",--49/99
}
BGM.len=#BGM.list
function BGM.loadOne(N) function BGM.loadOne(N)
N=BGM.list[N] N=BGM.list[N]
local file="/BGM/"..N..".ogg" local file="media/BGM/"..N..".ogg"
if love.filesystem.getInfo(file)then if love.filesystem.getInfo(file)then
BGM.list[N]=love.audio.newSource(file,"stream") BGM.list[N]=love.audio.newSource(file,"stream")
BGM.list[N]:setLooping(true) BGM.list[N]:setLooping(true)

View File

@@ -3,6 +3,7 @@ local fs=love.filesystem
local files={ local files={
data= fs.newFile("data.dat"), data= fs.newFile("data.dat"),
setting=fs.newFile("settings.dat"), setting=fs.newFile("settings.dat"),
network=fs.newFile("network.dat"),
VK= fs.newFile("virtualkey.dat"), VK= fs.newFile("virtualkey.dat"),
keyMap= fs.newFile("key.dat"), keyMap= fs.newFile("key.dat"),
unlock= fs.newFile("unlock.dat"), unlock= fs.newFile("unlock.dat"),
@@ -109,6 +110,28 @@ function FILE.saveSetting()
end end
end end
function FILE.loadAccount()
local F=files.setting
if F:open("r")then
local s=F:read()
if s:sub(1,6)~="return"then
s="return{"..s:gsub("\n",",").."}"
end
s=loadstring(s)
F:close()
if s then
setfenv(s,{})
addToTable(s(),ACCOUNT)
end
end
end
function FILE.saveAccount()
local F=files.setting
F:open("w")
F:write(dumpTable(ACCOUNT))
F:flush()F:close()
end
function FILE.loadKeyMap() function FILE.loadKeyMap()
local F=files.keyMap local F=files.keyMap
if F:open("r")then if F:open("r")then

View File

@@ -32,7 +32,7 @@ function IMG.getCount()
end end
function IMG.loadOne(_) function IMG.loadOne(_)
local N=list[_] local N=list[_]
IMG[N]=love.graphics.newImage("/image/"..IMG[N]) IMG[N]=love.graphics.newImage("media/image/"..IMG[N])
end end
function IMG.loadAll() function IMG.loadAll()
for i=1,count do for i=1,count do

View File

@@ -1,26 +1,26 @@
COLOR= require("Zframework/color") SCR= require"Zframework/screen"
SCN= require("Zframework/scene") COLOR= require"Zframework/color"
LOG= require("Zframework/log") SCN= require"Zframework/scene"
require("Zframework/toolfunc") LOG= require"Zframework/log"
require"Zframework/toolfunc"
VIB= require("Zframework/vib") VIB= require"Zframework/vibrate"
SFX= require("Zframework/sfx") SFX= require"Zframework/sfx"
LIGHT= require("Zframework/light") LIGHT= require"Zframework/light"
SHADER= require("Zframework/shader") BG= require"Zframework/background"
BG= require("Zframework/bg") WIDGET= require"Zframework/widget"
WIDGET= require("Zframework/widget") TEXT= require"Zframework/text"
TEXT= require("Zframework/text") SYSFX= require"Zframework/sysFX"
sysFX= require("Zframework/sysFX")
IMG= require("Zframework/img") IMG= require"Zframework/image"
BGM= require("Zframework/bgm") BGM= require"Zframework/bgm"
VOC= require("Zframework/voice") VOC= require"Zframework/voice"
LANG= require("Zframework/languages") LANG= require"Zframework/languages"
TASK= require("Zframework/task") TASK= require"Zframework/task"
FILE= require("Zframework/file") FILE= require"Zframework/file"
PROFILE=require("Zframework/profile") PROFILE=require"Zframework/profile"
local ms,kb=love.mouse,love.keyboard local ms,kb=love.mouse,love.keyboard
local gc=love.graphics local gc=love.graphics
@@ -58,14 +58,14 @@ local function updatePowerInfo()
end end
gc.rectangle("fill",76,6,pow*.22,14) gc.rectangle("fill",76,6,pow*.22,14)
if pow<100 then if pow<100 then
setFont(14) setFont(15)
gc.setColor(0,0,0) gc.setColor(0,0,0)
gc.print(pow,77,2) gc.print(pow,77,1)
gc.print(pow,77,4) gc.print(pow,77,3)
gc.print(pow,79,2) gc.print(pow,79,1)
gc.print(pow,79,4) gc.print(pow,79,3)
gc.setColor(1,1,1) gc.setColor(1,1,1)
gc.print(pow,78,3) gc.print(pow,78,2)
end end
end end
gc.draw(IMG.batteryImage,73,3) gc.draw(IMG.batteryImage,73,3)
@@ -94,7 +94,10 @@ function love.mousepressed(x,y,k,touch)
if touch then return end if touch then return end
mouseShow=true mouseShow=true
mx,my=xOy:inverseTransformPoint(x,y) mx,my=xOy:inverseTransformPoint(x,y)
if devMode==1 then DBP(mx,my)end if devMode==1 then
local dx,dy=mx-lastX,my-lastY
DBP(("(%d,%d), D=(%d,%d)~~(%d,%d)(%d,%d)"):format(mx,my,dx,dy,int(mx/10)*10,int(my/10)*10,int(dx/10)*10,int(dy/10)*10))
end
if SCN.swapping then return end if SCN.swapping then return end
if mouseDown[SCN.cur]then if mouseDown[SCN.cur]then
mouseDown[SCN.cur](mx,my,k) mouseDown[SCN.cur](mx,my,k)
@@ -105,7 +108,7 @@ function love.mousepressed(x,y,k,touch)
WIDGET.press(mx,my) WIDGET.press(mx,my)
end end
lastX,lastY=mx,my lastX,lastY=mx,my
sysFX.newRipple(.3,mx,my,30) SYSFX.newRipple(3,mx,my,30)
end end
function love.mousemoved(x,y,dx,dy,t) function love.mousemoved(x,y,dx,dy,t)
if t then return end if t then return end
@@ -188,7 +191,7 @@ function love.touchreleased(id,x,y)
if touchClick[SCN.cur]then if touchClick[SCN.cur]then
touchClick[SCN.cur](x,y) touchClick[SCN.cur](x,y)
end end
sysFX.newRipple(.3,x,y,30) SYSFX.newRipple(3,x,y,30)
end end
end end
@@ -303,7 +306,7 @@ function love.gamepadpressed(_,i)
if gamepadDown[SCN.cur]then gamepadDown[SCN.cur](i) if gamepadDown[SCN.cur]then gamepadDown[SCN.cur](i)
elseif keyDown[SCN.cur]then keyDown[SCN.cur](keyMirror[i]or i) elseif keyDown[SCN.cur]then keyDown[SCN.cur](keyMirror[i]or i)
elseif i=="back"then SCN.back() elseif i=="back"then SCN.back()
else WIDGET.gamepadPressed(i) else WIDGET.gamepadPressed(keyMirror[i]or i)
end end
end end
function love.gamepadreleased(_,i) function love.gamepadreleased(_,i)
@@ -431,7 +434,7 @@ function love.errorhandler(msg)
setFont(100)gc.print(":(",100,40,0,1.2) setFont(100)gc.print(":(",100,40,0,1.2)
setFont(40)gc.printf(text.errorMsg,100,200,SCR.w0-100) setFont(40)gc.printf(text.errorMsg,100,200,SCR.w0-100)
setFont(20) setFont(20)
gc.print(SYSTEM.."-"..VERSION,100,660) gc.print(SYSTEM.."-"..VERSION_NAME,100,660)
gc.print("scene:"..SCN.cur,400,660) gc.print("scene:"..SCN.cur,400,660)
gc.printf(err[1],626,360,1260-626) gc.printf(err[1],626,360,1260-626)
gc.print("TRACEBACK",626,426) gc.print("TRACEBACK",626,426)
@@ -501,7 +504,7 @@ function love.run()
TASK.update() TASK.update()
VOC.update() VOC.update()
BG.update(dt) BG.update(dt)
sysFX.update(dt) SYSFX.update(dt)
TEXT.update() TEXT.update()
_=Tmr[SCN.cur]if _ then _(dt)end--Scene Updater _=Tmr[SCN.cur]if _ then _(dt)end--Scene Updater
if SCN.swapping then SCN.swapUpdate()end--Scene swapping animation if SCN.swapping then SCN.swapUpdate()end--Scene swapping animation
@@ -513,9 +516,10 @@ function love.run()
FCT=FCT+SETTING.frameMul FCT=FCT+SETTING.frameMul
if FCT>=100 then if FCT>=100 then
FCT=FCT-100 FCT=FCT-100
DISCARD()--SPEED UPUPUP!
--Draw background
BG.draw() BG.draw()
gc.push("transform") gc.push("transform")
gc.replaceTransform(xOy) gc.replaceTransform(xOy)
@@ -535,7 +539,7 @@ function love.run()
gc.setColor(1,1,1,.5)gc.circle("fill",mx,my,5) gc.setColor(1,1,1,.5)gc.circle("fill",mx,my,5)
gc.setColor(1,1,1)gc.circle("fill",mx,my,3) gc.setColor(1,1,1)gc.circle("fill",mx,my,3)
end end
sysFX.draw() SYSFX.draw()
TEXT.draw() TEXT.draw()
gc.pop() gc.pop()
@@ -584,6 +588,7 @@ function love.run()
LOG.draw() LOG.draw()
PRESENT() PRESENT()
DISCARD()--SPEED UPUPUP!
end end
end end

View File

@@ -1,11 +1,11 @@
local langList={ local langList={
require("LANG/lang_zh"), require"parts/language/lang_zh",
require("LANG/lang_zh2"), require"parts/language/lang_zh2",
require("LANG/lang_en"), require"parts/language/lang_en",
require("LANG/lang_fr"), require"parts/language/lang_fr",
require("LANG/lang_sp"), require"parts/language/lang_sp",
require("LANG/lang_symbol"), require"parts/language/lang_symbol",
require("LANG/lang_yygq"), require"parts/language/lang_yygq",
--Add new language file to LANG folder. Attention, new language won't show in-game when you add language --Add new language file to LANG folder. Attention, new language won't show in-game when you add language
} }
local publicText={ local publicText={

View File

@@ -1,10 +1,13 @@
--LIGHT MODULE(Optimized by MrZ,Original on github/love2d community/simple-love-lights) --LIGHT MODULE (Optimized by MrZ, Original on github/love2d community/simple-love-lights)
--Heavily based on mattdesl's libGDX implementation: --Heavily based on mattdesl's libGDX implementation:
--https://github.com/mattdesl/lwjgl-basics/wiki/2D-Pixel-Perfect-Shadows --https://github.com/mattdesl/lwjgl-basics/wiki/2D-Pixel-Perfect-Shadows
local gc=love.graphics local gc=love.graphics
local C=gc.clear local clear,translate=gc.clear,gc.translate
local shadowMapShader=gc.newShader("Zframework/shader/shadowMap.glsl")--Shader for caculating the 1D shadow map. local setCanvas,setShader=gc.setCanvas,gc.setShader
local lightRenderShader=gc.newShader("Zframework/shader/lightRender.glsl")--Shader for rendering blurred lights and shadows. local render=gc.draw
local shadowMapShader=gc.newShader("Zframework/light/shadowMap.glsl")--Shader for caculating the 1D shadow map.
local lightRenderShader=gc.newShader("Zframework/light/lightRender.glsl")--Shader for rendering blurred lights and shadows.
local Lights={}--Lightsource objects local Lights={}--Lightsource objects
local function move(L,x,y) local function move(L,x,y)
L.x,L.y=x,y L.x,L.y=x,y
@@ -20,9 +23,9 @@ end
local function draw(L) local function draw(L)
--Initialization --Initialization
local r,g,b,a=love.graphics.getColor() local r,g,b,a=love.graphics.getColor()
gc.setCanvas(L.blackCanvas)C() setCanvas(L.blackCanvas)clear()
gc.setCanvas(L.shadowCanvas)C() setCanvas(L.shadowCanvas)clear()
gc.setCanvas(L.renderCanvas)C() setCanvas(L.renderCanvas)clear()
lightRenderShader:send("xresolution",L.size) lightRenderShader:send("xresolution",L.size)
shadowMapShader:send("yresolution",L.size) shadowMapShader:send("yresolution",L.size)
@@ -31,26 +34,26 @@ local function draw(L)
local Y=L.y-L.size*.5 local Y=L.y-L.size*.5
--Render solid --Render solid
gc.translate(-X,-Y) translate(-X,-Y)
L.blackCanvas:renderTo(L.blackFn) L.blackCanvas:renderTo(L.blackFn)
gc.translate(X,Y) translate(X,Y)
--Render shade canvas by solid --Render shade canvas by solid
gc.setShader(shadowMapShader) setShader(shadowMapShader)
gc.setCanvas(L.shadowCanvas) setCanvas(L.shadowCanvas)
gc.draw(L.blackCanvas) render(L.blackCanvas)
--Render light canvas by shade --Render light canvas by shade
gc.setShader(lightRenderShader) setShader(lightRenderShader)
gc.setCanvas(L.renderCanvas) setCanvas(L.renderCanvas)
gc.draw(L.shadowCanvas,0,0,0,1,L.size) render(L.shadowCanvas,0,0,0,1,L.size)
--Ready to final render --Ready to final render
gc.setShader()gc.setCanvas()gc.setBlendMode("add") setShader()setCanvas()gc.setBlendMode("add")
--Render to screes --Render to screes
gc.setColor(r,g,b,a) gc.setColor(r,g,b,a)
gc.draw(L.renderCanvas,X,Y+L.size,0,1,-1) render(L.renderCanvas,X,Y+L.size,0,1,-1)
--Reset --Reset
gc.setBlendMode("alpha") gc.setBlendMode("alpha")
@@ -71,7 +74,6 @@ end
function LIGHT.add(x,y,R,F) function LIGHT.add(x,y,R,F)
local id=#Lights+1 local id=#Lights+1
Lights[id]={ Lights[id]={
--Methods
id=id, id=id,
x=x,y=y,size=R, x=x,y=y,size=R,
blackCanvas=gc.newCanvas(R,R),--Solid canvas blackCanvas=gc.newCanvas(R,R),--Solid canvas
@@ -79,7 +81,6 @@ function LIGHT.add(x,y,R,F)
renderCanvas=gc.newCanvas(R,R),--Light canvas renderCanvas=gc.newCanvas(R,R),--Light canvas
blackFn=F,--Solid draw funcion blackFn=F,--Solid draw funcion
move=move, move=move,
setPow=setPow, setPow=setPow,
draw=draw, draw=draw,

View File

@@ -4,7 +4,7 @@ local ins,rem=table.insert,table.remove
local debugMesList={} local debugMesList={}
local debugMesHistory={ local debugMesHistory={
"Version: "..VERSION, "Version: "..VERSION_NAME,
os.date("Launched at %Y/%m/%d %H:%M"), os.date("Launched at %Y/%m/%d %H:%M"),
} }
local LOG={} local LOG={}

View File

@@ -15,21 +15,17 @@ local _ncalls = {}
-- list of internal profiler functions -- list of internal profiler functions
local _internal = {} local _internal = {}
local getInfo=debug.getinfo local getInfo = debug.getinfo
function profile.hooker(event, line, info) function profile.hooker(event, line, info)
info = info or getInfo(2, 'fnS') info = info or getInfo(2, 'fnS')
local f = info.func local f = info.func
-- ignore the profiler itself -- ignore the profiler itself
if _internal[f] or info.what ~= "Lua" then if _internal[f] or info.what ~= "Lua" then return end
return
end
-- get the function name if available -- get the function name if available
if info.name then if info.name then _labeled[f] = info.name end
_labeled[f] = info.name
end
-- find the line definition -- find the line definition
if not _defined[f] then if not _defined[f] then
_defined[f] = info.short_src..":"..info.linedefined _defined[f] = info.short_src .. ":" .. info.linedefined
_ncalls[f] = 0 _ncalls[f] = 0
_telapsed[f] = 0 _telapsed[f] = 0
end end
@@ -49,13 +45,6 @@ function profile.hooker(event, line, info)
end end
end end
--- Sets a clock function to be used by the profiler.
-- @param f Clock function that returns a number
function profile.setclock(f)
assert(type(f) == "function", "clock must be a function")
clock = f
end
--- Starts collecting data. --- Starts collecting data.
function profile.start() function profile.start()
if rawget(_G, 'jit') then if rawget(_G, 'jit') then
@@ -68,15 +57,15 @@ end
--- Stops collecting data. --- Stops collecting data.
function profile.stop() function profile.stop()
debug.sethook() debug.sethook()
for f in next,_tcalled do for f in next, _tcalled do
local dt = clock() - _tcalled[f] local dt = clock() - _tcalled[f]
_telapsed[f] = _telapsed[f] + dt _telapsed[f] = _telapsed[f] + dt
_tcalled[f] = nil _tcalled[f] = nil
end end
-- merge closures -- merge closures
local lookup = {} local lookup = {}
for f, d in next,_defined do for f, d in next, _defined do
local id = (_labeled[f] or '?')..d local id = (_labeled[f] or '?') .. d
local f2 = lookup[id] local f2 = lookup[id]
if f2 then if f2 then
_ncalls[f2] = _ncalls[f2] + (_ncalls[f] or 0) _ncalls[f2] = _ncalls[f2] + (_ncalls[f] or 0)
@@ -92,31 +81,22 @@ end
--- Resets all collected data. --- Resets all collected data.
function profile.reset() function profile.reset()
for f in next,_ncalls do for f in next, _ncalls do _ncalls[f] = 0 end
_ncalls[f] = 0 for f in next, _telapsed do _telapsed[f] = 0 end
end for f in next, _tcalled do _tcalled[f] = nil end
for f in next,_telapsed do
_telapsed[f] = 0
end
for f in next,_tcalled do
_tcalled[f] = nil
end
collectgarbage('collect') collectgarbage('collect')
end end
function profile.comp(a, b) function profile.comp(a, b)
local dt = _telapsed[b] - _telapsed[a] local dt = _telapsed[b] - _telapsed[a]
if dt == 0 then return dt == 0 and _ncalls[b] < _ncalls[a] or dt < 0
return _ncalls[b] < _ncalls[a]
end
return dt < 0
end end
--- Iterates all functions that have been called since the profile was started. --- Iterates all functions that have been called since the profile was started.
-- @param n Number of results (optional) -- @param n Number of results (optional)
function profile.query(limit) function profile.query(limit)
local t = {} local t = {}
for f, n in next,_ncalls do for f, n in next, _ncalls do
if n > 0 then if n > 0 then
t[#t + 1] = f t[#t + 1] = f
end end
@@ -132,12 +112,12 @@ function profile.query(limit)
if _tcalled[f] then if _tcalled[f] then
dt = clock() - _tcalled[f] dt = clock() - _tcalled[f]
end end
t[i] = { i, _labeled[f] or '?', _ncalls[f], _telapsed[f] + dt, _defined[f] } t[i] = {i, _labeled[f] or '?', _ncalls[f], _telapsed[f] + dt, _defined[f]}
end end
return t return t
end end
local cols = { 3, 29, 11, 24, 32 } local cols = {3, 29, 11, 24, 32}
function profile.report(n) function profile.report(n)
local out = {} local out = {}
local report = profile.query(n) local report = profile.query(n)
@@ -148,7 +128,7 @@ function profile.report(n)
s = tostring(s) s = tostring(s)
local l1 = s:len() local l1 = s:len()
if l1 < l2 then if l1 < l2 then
s = s..(' '):rep(l2-l1) s = s .. (' '):rep(l2 - l1)
elseif l1 > l2 then elseif l1 > l2 then
s = s:sub(l1 - l2 + 1, l1) s = s:sub(l1 - l2 + 1, l1)
end end
@@ -159,14 +139,14 @@ function profile.report(n)
local row = " +-----+-------------------------------+-------------+--------------------------+----------------------------------+ \n" local row = " +-----+-------------------------------+-------------+--------------------------+----------------------------------+ \n"
local col = " | # | Function | Calls | Time | Code | \n" local col = " | # | Function | Calls | Time | Code | \n"
local sz = row..col..row local sz = row .. col .. row
if #out > 0 then if #out > 0 then
sz = sz..' | '..table.concat(out, ' | \n | ')..' | \n' sz = sz .. ' | ' .. table.concat(out, ' | \n | ') .. ' | \n'
end end
return '\n'..sz..row return '\n' .. sz .. row
end end
local switch=false local switch = false
function profile.switch() function profile.switch()
if switch then if switch then
profile.stop() profile.stop()
@@ -177,14 +157,12 @@ function profile.switch()
PROFILE.start() PROFILE.start()
LOG.print("profile start!") LOG.print("profile start!")
end end
switch=not switch switch = not switch
end end
-- store all internal profiler functions -- store all internal profiler functions
for _, v in next,profile do for _, v in next, profile do
if type(v) == "function" then if type(v) == "function" then _internal[v] = true end
_internal[v] = true
end
end end
return profile return profile

14
Zframework/screen.lua Normal file
View File

@@ -0,0 +1,14 @@
local SCR={
w0=1280,h0=720,--Default Screen Size
x=0,y=0,--Up-left Coord on screen
w=0,h=0,--Fullscreen w/h in gc
W=0,H=0,--Fullscreen w/h in shader
rad=0,--Radius
k=1,--Scale size
dpi=1,--DPI from gc.getDPIScale()
xOy=love.math.newTransform(),--Screen transformation object
}
function SCR.setSize(w,h)
SCR.w0,SCR.h0=w,h
end
return SCR

View File

@@ -1,32 +1,13 @@
local rem=table.remove local rem=table.remove
local SFX={} local SFX={}
SFX.list={ function SFX.set(L)
"welcome_sfx", SFX.list=L
"click","enter", SFX.len=#L
"finesseError","finesseError_long", end
--Stereo sfxs(cannot set position)
"virtualKey",
"button","swipe",
"ready","start","win","fail","collect",
"spawn_1","spawn_2","spawn_3","spawn_4","spawn_5","spawn_6","spawn_7",
"move","rotate","rotatekick","hold",
"prerotate","prehold",
"lock","drop","fall",
"reach",
"ren_1","ren_2","ren_3","ren_4","ren_5","ren_6","ren_7","ren_8","ren_9","ren_10","ren_11","ren_mega",
"clear_1","clear_2","clear_3","clear_4",
"spin_0","spin_1","spin_2","spin_3",
"emit","blip_1","blip_2",
"clear",
"error",
--Mono sfxs
}
function SFX.loadOne(_) function SFX.loadOne(_)
_,SFX.list[_]=SFX.list[_] _,SFX.list[_]=SFX.list[_]
local N="/SFX/".._..".ogg" local N="media/SFX/".._..".ogg"
if love.filesystem.getInfo(N)then if love.filesystem.getInfo(N)then
SFX.list[_]={love.audio.newSource(N,"static")} SFX.list[_]={love.audio.newSource(N,"static")}
else else

View File

@@ -1,14 +0,0 @@
local function N(file)
return love.graphics.newShader("Zframework/shader/"..file..".glsl")
end
return{
-- glow=gc.newShader("Zframework/shader/glow.cs"),
alpha=N("alpha"),
warning=N("warning"),
aura=N("aura"),
gradient1=N("grad1"),--Horizonal red-blue gradient
gradient2=N("grad2"),--Vertical red-green gradient
rgb1=N("rgb1"),--Colorful RGB
rgb2=N("rgb2"),--Blue RGB
}

View File

@@ -1,5 +0,0 @@
extern float X,Y,W,H;
vec4 effect(vec4 C,Image Tx,vec2 pos,vec2 scr_pos){
C[3]=min((scr_pos.x-X)/W*0.3+(scr_pos.y-Y)/H*0.1,0.3)+0.5;
return C;
}

View File

@@ -1,10 +1,16 @@
local gc=love.graphics local gc=love.graphics
local setColor,setWidth=gc.setColor,gc.setLineWidth local setColor,setWidth=gc.setColor,gc.setLineWidth
local max,min=math.max,math.min local max,min=math.max,math.min
local rnd=math.random
local rem=table.remove local rem=table.remove
local fx={} local fx={}
local function normUpdate(S,dt)
S.t=S.t+dt*S.rate
return S.t>1
end
local FXupdate={} local FXupdate={}
function FXupdate.badge(S,dt) function FXupdate.badge(S,dt)
S.t=S.t+dt S.t=S.t+dt
@@ -19,22 +25,22 @@ function FXupdate.badge(S,dt)
end end
return S.t>=1 return S.t>=1
end end
function FXupdate.attack(S,dt) FXupdate.attack=normUpdate
FXupdate.ripple=normUpdate
FXupdate.rectRipple=normUpdate
FXupdate.shade=normUpdate
function FXupdate.cell(S,dt)
if S.vx then
S.x=S.x+S.vx*S.rate
S.y=S.y+S.vy*S.rate
if S.ax then
S.vx=S.vx+S.ax*S.rate
S.vy=S.vy+S.ay*S.rate
end
end
S.t=S.t+dt*S.rate S.t=S.t+dt*S.rate
return S.t>1 return S.t>1
end end
function FXupdate.ripple(S,dt)
S.t=S.t+dt*S.rate
return S.t>=1
end
function FXupdate.rectRipple(S,dt)
S.t=S.t+dt*S.rate
return S.t>=1
end
function FXupdate.shade(S,dt)
S.t=S.t+dt*S.rate
return S.t>=1
end
local FXdraw={} local FXdraw={}
function FXdraw.badge(S) function FXdraw.badge(S)
@@ -78,22 +84,26 @@ function FXdraw.shade(S)
setColor(S.r,S.g,S.b,1-S.t) setColor(S.r,S.g,S.b,1-S.t)
gc.rectangle("fill",S.x,S.y,S.w,S.h,2) gc.rectangle("fill",S.x,S.y,S.w,S.h,2)
end end
function FXdraw.cell(S,dt)
setColor(1,1,1,1-S.t)
gc.draw(S.image,S.x,S.y,nil,S.size,nil,S.cx,S.cy)
end
local sysFX={} local SYSFX={}
function sysFX.update(dt) function SYSFX.update(dt)
for i=#fx,1,-1 do for i=#fx,1,-1 do
if fx[i]:update(dt) then if fx[i]:update(dt) then
rem(fx,i) rem(fx,i)
end end
end end
end end
function sysFX.draw() function SYSFX.draw()
for i=1,#fx do for i=1,#fx do
fx[i]:draw() fx[i]:draw()
end end
end end
function sysFX.newBadge(x1,y1,x2,y2) function SYSFX.newBadge(x1,y1,x2,y2)
fx[#fx+1]={ fx[#fx+1]={
update=FXupdate.badge, update=FXupdate.badge,
draw=FXdraw.badge, draw=FXdraw.badge,
@@ -103,7 +113,7 @@ function sysFX.newBadge(x1,y1,x2,y2)
x2=x2,y2=y2, x2=x2,y2=y2,
} }
end end
function sysFX.newAttack(rate,x1,y1,x2,y2,wid,r,g,b,a) function SYSFX.newAttack(rate,x1,y1,x2,y2,wid,r,g,b,a)
fx[#fx+1]={ fx[#fx+1]={
update=FXupdate.attack, update=FXupdate.attack,
draw=FXdraw.attack, draw=FXdraw.attack,
@@ -115,32 +125,45 @@ function sysFX.newAttack(rate,x1,y1,x2,y2,wid,r,g,b,a)
r=r,g=g,b=b,a=a, r=r,g=g,b=b,a=a,
} }
end end
function sysFX.newRipple(duration,x,y,r) function SYSFX.newRipple(rate,x,y,r)
fx[#fx+1]={ fx[#fx+1]={
update=FXupdate.ripple, update=FXupdate.ripple,
draw=FXdraw.ripple, draw=FXdraw.ripple,
t=0, t=0,
rate=1/duration, rate=rate,
x=x,y=y,r=r, x=x,y=y,r=r,
} }
end end
function sysFX.newRectRipple(duration,x,y,w,h) function SYSFX.newRectRipple(rate,x,y,w,h)
fx[#fx+1]={ fx[#fx+1]={
update=FXupdate.rectRipple, update=FXupdate.rectRipple,
draw=FXdraw.rectRipple, draw=FXdraw.rectRipple,
t=0, t=0,
rate=1/duration, rate=rate,
x=x,y=y,w=w,h=h, x=x,y=y,w=w,h=h,
} }
end end
function sysFX.newShade(duration,r,g,b,x,y,w,h) function SYSFX.newShade(rate,r,g,b,x,y,w,h)
fx[#fx+1]={ fx[#fx+1]={
update=FXupdate.shade, update=FXupdate.shade,
draw=FXdraw.shade, draw=FXdraw.shade,
t=0, t=0,
rate=1/duration, rate=rate,
r=r,g=g,b=b, r=r,g=g,b=b,
x=x,y=y,w=w,h=h, x=x,y=y,w=w,h=h,
} }
end end
return sysFX function SYSFX.newCell(rate,image,size,x,y,vx,vy,ax,ay)
fx[#fx+1]={
update=FXupdate.cell,
draw=FXdraw.cell,
t=0,
rate=rate*(.9+rnd()*.2),
image=image,size=size,
cx=image:getWidth()*.5,cy=image:getHeight()*.5,
x=x,y=y,
vx=vx,vy=vy,
ax=ax,ay=ay,
}
end
return SYSFX

View File

@@ -166,9 +166,10 @@ end
do--httpRequest do--httpRequest
client=LOADLIB("NETlib") client=LOADLIB("NETlib")
httpRequest= httpRequest=
client and function(tick,api,method,header,body) client and function(tick,path,method,header,body)
local task,err=client.httpraw{ local task,err=client.httpraw{
url="http://47.103.200.40/"..api, -- url="http://47.103.200.40/"..path,
url="http://krakens.tpddns.cn:10026"..path,
method=method or"GET", method=method or"GET",
header=header, header=header,
body=body, body=body,
@@ -302,7 +303,8 @@ do--json
end end
function json.encode(val) function json.encode(val)
return pcall(encode,val) local a,b=pcall(encode,val)
if a then return b else return""end
end end
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
@@ -529,9 +531,11 @@ do--json
return res return res
end end
function json.decode(str) function json.decode(str)
return pcall(decode,str) local a,b=pcall(decode,str)
if a then return b else return""end
end end
end end
do--urlencode do--urlencode
local rshift=bit.rshift local rshift=bit.rshift
local b16={[0]="0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"} local b16={[0]="0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"}

View File

@@ -3,25 +3,21 @@ local rem=table.remove
local voiceQueue={free=0} local voiceQueue={free=0}
local bank={}--{vocName1={SRC1s},vocName2={SRC2s},...} local bank={}--{vocName1={SRC1s},vocName2={SRC2s},...}
local VOC={} local VOC={}
VOC.name={
"zspin","sspin","lspin","jspin","tspin","ospin","ispin",
"single","double","triple","techrash",
"mini","b2b","b3b",
"perfect_clear","half_clear",
"win","lose","bye",
"test","happy","doubt","sad","egg",
"welcome_voc",
}
VOC.list={} VOC.list={}
local function loadVoiceFile(N,vocName) local function loadVoiceFile(N,vocName)
local fileName="VOICE/"..SETTING.cv.."/"..vocName..".ogg" local fileName="media/VOICE/"..SETTING.cv.."/"..vocName..".ogg"
if love.filesystem.getInfo(fileName)then if love.filesystem.getInfo(fileName)then
bank[vocName]={love.audio.newSource(fileName,"static")} bank[vocName]={love.audio.newSource(fileName,"static")}
table.insert(VOC.list[N],vocName) table.insert(VOC.list[N],vocName)
return true return true
end end
end end
function VOC.set(L)
VOC.name=L
VOC.len=#L
end
function VOC.loadOne(name) function VOC.loadOne(name)
local N=VOC.name[name] local N=VOC.name[name]
VOC.list[N]={} VOC.list[N]={}

View File

@@ -19,6 +19,7 @@ local widgetMetatable={
local text={ local text={
type="text", type="text",
alpha=0,
} }
function text:reset() function text:reset()
if type(self.text)=="string"then if type(self.text)=="string"then
@@ -29,14 +30,26 @@ function text:reset()
self.font=self.font-10 self.font=self.font-10
end end
end end
function text:update()
if self.hideCon and self.hideCon()then
if self.alpha>0 then
self.alpha=self.alpha-.125
end
elseif self.alpha<1 then
self.alpha=self.alpha+.125
end
end
function text:draw() function text:draw()
gc.setColor(self.color) if self.alpha>0 then
if self.align=="M"then local c=self.color
gc.draw(self.text,self.x-self.text:getWidth()*.5,self.y) gc.setColor(c[1],c[2],c[3],self.alpha)
elseif self.align=="L"then if self.align=="M"then
gc.draw(self.text,self.x,self.y) gc.draw(self.text,self.x-self.text:getWidth()*.5,self.y)
elseif self.align=="R"then elseif self.align=="L"then
gc.draw(self.text,self.x-self.text:getWidth(),self.y) gc.draw(self.text,self.x,self.y)
elseif self.align=="R"then
gc.draw(self.text,self.x-self.text:getWidth(),self.y)
end
end end
end end
function WIDGET.newText(D)--name,x,y[,color][,font=30][,align="M"][,hide] function WIDGET.newText(D)--name,x,y[,color][,font=30][,align="M"][,hide]
@@ -47,9 +60,10 @@ function WIDGET.newText(D)--name,x,y[,color][,font=30][,align="M"][,hide]
color= D.color and(COLOR[D.color]or D.color)or COLOR.white, color= D.color and(COLOR[D.color]or D.color)or COLOR.white,
font= D.font or 30, font= D.font or 30,
align= D.align or"M", align= D.align or"M",
hide= D.hide, hideCon=D.hide,
} }
for k,v in next,text do _[k]=v end for k,v in next,text do _[k]=v end
if not _.hideCon then _.alpha=1 end
setmetatable(_,widgetMetatable) setmetatable(_,widgetMetatable)
return _ return _
end end
@@ -102,8 +116,8 @@ function button:getCenter()
end end
function button:FX() function button:FX()
local ATV=self.ATV local ATV=self.ATV
sysFX.newRectRipple( SYSFX.newRectRipple(
.16, 6,
self.x-ATV, self.x-ATV,
self.y-ATV, self.y-ATV,
self.w+2*ATV, self.w+2*ATV,
@@ -145,6 +159,11 @@ end
function button:getInfo() function button:getInfo()
return format("x=%d,y=%d,w=%d,h=%d,font=%d",self.x+self.w*.5,self.y+self.h*.5,self.w,self.h,self.font) return format("x=%d,y=%d,w=%d,h=%d,font=%d",self.x+self.w*.5,self.y+self.h*.5,self.w,self.h,self.font)
end end
function button:press()
self.code()
self:FX()
SFX.play("button")
end
function WIDGET.newButton(D)--name,x,y,w[,h][,color][,font],code[,hide] function WIDGET.newButton(D)--name,x,y,w[,h][,color][,font],code[,hide]
if not D.h then D.h=D.w end if not D.h then D.h=D.w end
local _={ local _={
@@ -220,6 +239,9 @@ end
function key:getInfo() function key:getInfo()
return format("x=%d,y=%d,w=%d,h=%d,font=%d",self.x+self.w*.5,self.y+self.h*.5,self.w,self.h,self.font) return format("x=%d,y=%d,w=%d,h=%d,font=%d",self.x+self.w*.5,self.y+self.h*.5,self.w,self.h,self.font)
end end
function key:press()
self.code()
end
function WIDGET.newKey(D)--name,x,y,w[,h][,color][,font],code[,hide] function WIDGET.newKey(D)--name,x,y,w[,h][,color][,font],code[,hide]
if not D.h then D.h=D.w end if not D.h then D.h=D.w end
local _={ local _={
@@ -304,6 +326,10 @@ end
function switch:getInfo() function switch:getInfo()
return format("x=%d,y=%d,font=%d",self.x,self.y,self.font) return format("x=%d,y=%d,font=%d",self.x,self.y,self.font)
end end
function switch:press()
self.code()
SFX.play("move")
end
function WIDGET.newSwitch(D)--name,x,y[,font][,disp],code,hide function WIDGET.newSwitch(D)--name,x,y[,font][,disp],code,hide
local _={ local _={
name= D.name, name= D.name,
@@ -423,6 +449,37 @@ end
function slider:getInfo() function slider:getInfo()
return format("x=%d,y=%d,w=%d",self.x,self.y,self.w) return format("x=%d,y=%d,w=%d",self.x,self.y,self.w)
end end
function slider:drag(x)
if not x then return end
x=x-self.x
local p=self.disp()
local P=x<0 and 0 or x>self.w and self.unit or x/self.w*self.unit
if not self.smooth then
P=int(P+.5)
end
if p~=P then
self.code(P)
end
if self.change and Timer()-self.lastTime>.18 then
self.lastTime=Timer()
self.change()
end
end
function slider:release(x)
self.lastTime=0
self:drag(x)
end
function slider:arrowKey(isLeft)
local p=self.disp()
local u=(self.smooth and .01 or 1)
local P=isLeft and max(p-u,0)or min(p+u,self.unit)
if p==P or not P then return end
self.code(P)
if self.change and Timer()-self.lastTime>.18 then
self.lastTime=Timer()
self.change()
end
end
function WIDGET.newSlider(D)--name,x,y,w[,unit][,smooth][,font][,change],disp,code,hide function WIDGET.newSlider(D)--name,x,y,w[,unit][,smooth][,font][,change],disp,code,hide
local _={ local _={
name= D.name, name= D.name,
@@ -542,7 +599,7 @@ function selector:draw()
end end
--Text --Text
setFont(28) setFont(30)
t=self.text t=self.text
if t then if t then
gc.setColor(r,g,b) gc.setColor(r,g,b)
@@ -554,6 +611,43 @@ end
function selector:getInfo() function selector:getInfo()
return format("x=%d,y=%d,w=%d",self.x+self.w*.5,self.y+30,self.w) return format("x=%d,y=%d,w=%d",self.x+self.w*.5,self.y+30,self.w)
end end
function selector:press(x)
if x then
local s=self.select
if x<self.x+self.w*.5 then
if s>1 then
s=s-1
SYSFX.newShade(3,1,1,1,self.x,self.y,self.w*.5,60)
end
else
if s<#self.list then
s=s+1
SYSFX.newShade(3,1,1,1,self.x+self.w*.5,self.y,self.w*.5,60)
end
end
if self.select~=s then
self.code(self.list[s])
self.select=s
self.selText=self.list[s]
SFX.play("prerotate")
end
end
end
function selector:arrowKey(isLeft)
local s=self.select
if isLeft and s==1 or not isLeft and s==#self.list then return end
if isLeft then
s=s-1
SYSFX.newShade(3,1,1,1,self.x,self.y,self.w*.5,60)
else
s=s+1
SYSFX.newShade(3,1,1,1,self.x+self.w*.5,self.y,self.w*.5,60)
end
self.code(self.list[s])
self.select=s
self.selText=self.list[s]
SFX.play("prerotate")
end
function WIDGET.newSelector(D)--name,x,y,w[,color],list,disp,code,hide function WIDGET.newSelector(D)--name,x,y,w[,color],list,disp,code,hide
local _={ local _={
name= D.name, name= D.name,
@@ -643,6 +737,27 @@ end
function textBox:getInfo() function textBox:getInfo()
return format("x=%d,y=%d,w=%d,h=%d",self.x+self.w*.5,self.y+self.h*.5,self.w,self.h) return format("x=%d,y=%d,w=%d,h=%d",self.x+self.w*.5,self.y+self.h*.5,self.w,self.h)
end end
function textBox:press()
if MOBILE then
local _,y1=SCR.xOy:transformPoint(0,self.y+self.h)
kb.setTextInput(true,0,y1,1,1)
end
end
function textBox:keypress(k)
local t=self.value
if #t==0 then return end
if k=="backspace"then
while t:byte(#t)>=128 and t:byte(#t)<192 do
t=sub(t,1,-2)
end
t=sub(t,1,-2)
SFX.play("lock")
elseif k=="delete"then
t=""
SFX.play("hold")
end
self.value=t
end
function WIDGET.newTextBox(D)--name,x,y,w[,h][,font][,secret][,regex],hide function WIDGET.newTextBox(D)--name,x,y,w[,h][,font][,secret][,regex],hide
local _={ local _={
name= D.name, name= D.name,
@@ -741,43 +856,10 @@ end
function WIDGET.press(x,y) function WIDGET.press(x,y)
local W=WIDGET.sel local W=WIDGET.sel
if not W then return end if not W then return end
if W.type=="button"then if W.type=="button"or W.type=="key"or W.type=="switch"or W.type=="selector"or W.type=="textBox"then
W.code() W:press(x,y)
W:FX()
SFX.play("button")
elseif W.type=="key"then
W.code()
elseif W.type=="switch"then
W.code()
SFX.play("move")
elseif W.type=="slider"then elseif W.type=="slider"then
WIDGET.drag(x,y) WIDGET.drag(x,y)
elseif W.type=="selector"then
if x then
local s=W.select
if x<W.x+W.w*.5 then
if s>1 then
s=s-1
sysFX.newShade(.3,1,1,1,W.x,W.y,W.w*.5,60)
end
else
if s<#W.list then
s=s+1
sysFX.newShade(.3,1,1,1,W.x+W.w*.5,W.y,W.w*.5,60)
end
end
if W.select~=s then
W.code(W.list[s])
W.select=s
W.selText=W.list[s]
SFX.play("prerotate")
end
end
elseif W.type=="textBox"then
if MOBILE then
local _,y1=SCR.xOy:transformPoint(0,W.y+W.h)
kb.setTextInput(true,0,y1,1,1)
end
end end
if W.hide and W.hide()then WIDGET.sel=nil end if W.hide and W.hide()then WIDGET.sel=nil end
end end
@@ -785,20 +867,7 @@ function WIDGET.drag(x,y)
local W=WIDGET.sel local W=WIDGET.sel
if not W then return end if not W then return end
if W.type=="slider"then if W.type=="slider"then
if not x then return end W:drag(x,y)
x=x-W.x
local p=W.disp()
local P=x<0 and 0 or x>W.w and W.unit or x/W.w*W.unit
if not W.smooth then
P=int(P+.5)
end
if p~=P then
W.code(P)
end
if W.change and Timer()-W.lastTime>.18 then
W.lastTime=Timer()
W.change()
end
elseif not W:isAbove(x,y)then elseif not W:isAbove(x,y)then
WIDGET.sel=nil WIDGET.sel=nil
end end
@@ -807,44 +876,19 @@ function WIDGET.release(x,y)
local W=WIDGET.sel local W=WIDGET.sel
if not W then return end if not W then return end
if W.type=="slider"then if W.type=="slider"then
W.lastTime=0 W:release(x,y)
WIDGET.drag(x,y)
end end
end end
function WIDGET.keyPressed(key) function WIDGET.keyPressed(k)
if key=="space"or key=="return"then if k=="space"or k=="return"then
WIDGET.press() WIDGET.press()
elseif kb.isDown("lshift","lalt","lctrl")and(key=="left"or key=="right")then elseif kb.isDown("lshift","lalt","lctrl")and(k=="left"or k=="right")then
--When hold [↑], control slider with left/right --When hold [↑], control slider with left/right
local W=WIDGET.sel local W=WIDGET.sel
if not W then return end if W and W.type=="slider"or W.type=="selector"then
local isLeft=key=="left" W:arrowKey(k=="left")
if W.type=="slider"then
local p=W.disp()
local u=(W.smooth and .01 or 1)
local P=isLeft and max(p-u,0)or min(p+u,W.unit)
if p==P or not P then return end
W.code(P)
if W.change and Timer()-W.lastTime>.18 then
W.lastTime=Timer()
W.change()
end
elseif W.type=="selector"then
local s=W.select
if isLeft and s==1 or not isLeft and s==#W.list then return end
if isLeft then
s=s-1
sysFX.newShade(.3,1,1,1,W.x,W.y,W.w*.5,60)
else
s=s+1
sysFX.newShade(.3,1,1,1,W.x+W.w*.5,W.y,W.w*.5,60)
end
W.code(W.list[s])
W.select=s
W.selText=W.list[s]
SFX.play("prerotate")
end end
elseif key=="up"or key=="down"or key=="left"or key=="right"then elseif k=="up"or k=="down"or k=="left"or k=="right"then
if not WIDGET.sel then if not WIDGET.sel then
for _,v in next,WIDGET.active do for _,v in next,WIDGET.active do
if v.isAbove then if v.isAbove then
@@ -857,10 +901,10 @@ function WIDGET.keyPressed(key)
local W=WIDGET.sel local W=WIDGET.sel
if not W.getCenter then return end if not W.getCenter then return end
local WX,WY=W:getCenter() local WX,WY=W:getCenter()
local dir=(key=="right"or key=="down")and 1 or -1 local dir=(k=="right"or k=="down")and 1 or -1
local tar local tar
local minDist=1e99 local minDist=1e99
local swap_xy=key=="up"or key=="down" local swap_xy=k=="up"or k=="down"
if swap_xy then WX,WY=WY,WX end -- note that we do not swap them back later if swap_xy then WX,WY=WY,WX end -- note that we do not swap them back later
for _,W1 in ipairs(WIDGET.active)do for _,W1 in ipairs(WIDGET.active)do
if W~=W1 and W1.resCtr then if W~=W1 and W1.resCtr then
@@ -882,20 +926,11 @@ function WIDGET.keyPressed(key)
if tar then if tar then
WIDGET.sel=tar WIDGET.sel=tar
end end
elseif WIDGET.sel and WIDGET.sel.type=="textBox"then else
local t=WIDGET.sel.value local W=WIDGET.sel
if #t==0 then return end if W and W.type=="textBox"then
if key=="backspace"then W:keypress(k)
while t:byte(#t)>=128 and t:byte(#t)<192 do
t=sub(t,1,-2)
end
t=sub(t,1,-2)
SFX.play("lock")
elseif key=="delete"then
t=""
SFX.play("hold")
end end
WIDGET.sel.value=t
end end
end end
local keyMirror={ local keyMirror={

View File

@@ -1,4 +1,5 @@
VERSION="Alpha V0.12.0" VERSION_CODE=1203
VERSION_NAME="Alpha V0.12.3"
love.setDeprecationOutput(false) love.setDeprecationOutput(false)
function love.conf(t) function love.conf(t)
t.identity="Techmino"--Saving folder t.identity="Techmino"--Saving folder
@@ -6,11 +7,14 @@ function love.conf(t)
t.gammacorrect=false t.gammacorrect=false
t.appendidentity=true--Search files in source then in save directory t.appendidentity=true--Search files in source then in save directory
t.accelerometerjoystick=false--Accelerometer=joystick on ios/android t.accelerometerjoystick=false--Accelerometer=joystick on ios/android
if t.audio then t.audio.mixwithsystem=true end if t.audio then
t.audio.mic=false
t.audio.mixwithsystem=true
end
local W=t.window local W=t.window
W.title="Techmino "..VERSION W.title="Techmino "..VERSION_NAME
W.icon="/image/icon.png" W.icon="media/image/icon.png"
W.width,W.height=1280,720 W.width,W.height=1280,720
W.minwidth,W.minheight=640,360 W.minwidth,W.minheight=640,360
W.borderless=false W.borderless=false
@@ -31,5 +35,5 @@ function love.conf(t)
M.math,M.data=true,true M.math,M.data=true,true
M.timer,M.graphics,M.font,M.image=true,true,true,true M.timer,M.graphics,M.font,M.image=true,true,true,true
M.mouse,M.touch,M.keyboard,M.joystick=true,true,true,true M.mouse,M.touch,M.keyboard,M.joystick=true,true,true,true
M.physics,M.thread,M.video=false,false,false M.physics,M.thread,M.video=false,true,false
end end

201
main.lua
View File

@@ -29,110 +29,95 @@ love.keyboard.setKeyRepeat(true)
love.keyboard.setTextInput(false) love.keyboard.setTextInput(false)
love.mouse.setVisible(false) love.mouse.setVisible(false)
SCR={
w0=1280,h0=720,--Default Screen Size
x=0,y=0,--Up-left Coord on screen
w=0,h=0,--Fullscreen w/h in gc
W=0,H=0,--Fullscreen w/h in shader
rad=0,--Radius
k=1,--Scale size
dpi=1,--DPI from gc.getDPIScale()
xOy=love.math.newTransform(),--Screen transformation object
}
CUSTOMENV={
--Basic
drop=60,
lock=60,
wait=0,
fall=0,
next=6,
hold=true,
oncehold=true,
--Visual
block=true,
ghost=.3,
center=1,
bagLine=false,
highCam=false,
nextPos=false,
bone=false,
--Rule
mindas=0,
minarr=0,
minsdarr=0,
sequence="bag",
ospin=false,
noTele=false,
fineKill=false,
missionKill=false,
easyFresh=true,
visible="show",
target=1e99,
freshLimit=1e99,
opponent=0,
life=0,
pushSpeed=3,
--Else
bg="none",
bgm="race"
}
FIELD={}--Field(s) for custom game
BAG={}--Sequence for custom game
MISSION={}--Clearing mission for custom game
GAME={
frame=0, --Frame count
result=false, --Game result (string)
pauseTime=0, --Time paused
pauseCount=0, --Pausing count
garbageSpeed=1, --Garbage timing speed
warnLVL0=0, --Warning level
warnLVL=0, --Warning level (show)
recording=false, --If recording
replaying=false, --If replaying
seed=math.random(2e6),--Game seed
setting={}, --Game settings
rec={}, --Recording list, key,time,key,time...
rank=nil, --Rank reached
prevBG=nil, --Previous background, for restore BG when quit setting page
--Data for royale mode
stage=nil, --Game stage
mostBadge=nil, --Most badge owner
secBadge=nil, --Second badge owner
mostDangerous=nil, --Most dangerous player
secDangerous=nil, --Second dangerous player
}--Global game data
PLAYERS={alive={}}--Players data
CURMODE=nil--Current mode object
RANKS={sprint_10=0}
--Load modules --Load modules
require("Zframework") require"Zframework"
require("parts/list") require"parts/list"
require("parts/default_data") require"parts/globalTables"
require("parts/gametoolfunc") require"parts/gametoolfunc"
SCR.setSize(1280,720)--Initialize Screen size
FIELD[1]=newBoard()--Initialize field[1] FIELD[1]=newBoard()--Initialize field[1]
BLOCKS= require("parts/mino") BLOCKS= require"parts/mino"
AIBUILDER= require("parts/AITemplate") AIBUILDER= require"parts/AITemplate"
FREEROW= require("parts/freeRow") FREEROW= require"parts/freeRow"
TEXTURE=require("parts/texture") TEXTURE=require"parts/texture"
SKIN= require("parts/skin") SKIN= require"parts/skin"
PLY= require("parts/player") PLY= require"parts/player"
AIFUNC= require("parts/ai") AIFUNC= require"parts/ai"
MODES= require("parts/modes") MODES= require"parts/modes"
TICK= require("parts/tick") TICK= require"parts/tick"
SFX.set{
"welcome_sfx",
"click","enter",
"finesseError","finesseError_long",
--Stereo sfxs(cannot set position)
"virtualKey",
"button","swipe",
"ready","start","win","fail","collect",
"spawn_1","spawn_2","spawn_3","spawn_4","spawn_5","spawn_6","spawn_7",
"move","rotate","rotatekick","hold",
"prerotate","prehold",
"lock","drop","fall",
"reach",
"ren_1","ren_2","ren_3","ren_4","ren_5","ren_6","ren_7","ren_8","ren_9","ren_10","ren_11","ren_mega",
"clear_1","clear_2","clear_3","clear_4",
"spin_0","spin_1","spin_2","spin_3",
"emit","blip_1","blip_2",
"clear",
"error",
--Mono sfxs
}
BGM.set{
"blank",--menu
"race",--sprint, solo
"infinite",--infinite norm/dig, ultra, zen, tech-finesse
"push",--marathon, round, tsd, blind-5/6
"way",--dig sprint
"reason",--drought, blind-1/2/3/4
"secret8th",--master-1, survivor-2
"secret7th",--master-2, survivor-3
"waterfall",--sprint Penta/MPH
"new era",--bigbang, survivor-1, tech-normal
"oxygen",--c4w/pc train
"truth",--pc challenge
"sugar fairy",--classic2
"distortion",--master-3
"far",--GM
"shining terminal",--attacker
"storm",--defender, survivor-4/5
"down",--dig, tech-hard/lunatic
"rockblock",--classic, 49/99
"cruelty","final","8-bit happiness","end","how feeling",--49/99
}
VOC.set{
"zspin","sspin","lspin","jspin","tspin","ospin","ispin",
"single","double","triple","techrash",
"mini","b2b","b3b",
"perfect_clear","half_clear",
"win","lose","bye",
"test","happy","doubt","sad","egg",
"welcome_voc",
}
--Load shader files from SOURCE ONLY
SHADER={}
for _,v in next,love.filesystem.getDirectoryItems("parts/shaders")do
if love.filesystem.getRealDirectory("parts/shaders/"..v)~=SAVEDIR then
local name=v:sub(1,-6)
SHADER[name]=love.graphics.newShader("parts/shaders/"..name..".glsl")
else
LOG.print("Dangerous file : %SAVE%/parts/shaders/"..v)
end
end
--Load background files from SOURCE ONLY --Load background files from SOURCE ONLY
for _,v in next,love.filesystem.getDirectoryItems("parts/backgrounds")do for _,v in next,love.filesystem.getDirectoryItems("parts/backgrounds")do
@@ -212,19 +197,21 @@ do
if S.extraRate then if S.extraRate then
S.finesseRate=5*(S.piece-S.extraRate) S.finesseRate=5*(S.piece-S.extraRate)
end end
if S.version~=VERSION then if S.version~=VERSION_NAME then
S.version=VERSION S.version=VERSION_NAME
newVersionLaunch=true newVersionLaunch=true
local function delRecord(n) if not VERSION_NAME:find("0.12")or VERSION_NAME:find("0.12.0")then
if R[n]then local function delRecord(n)
R[n]=0 if R[n]then
fs.remove(n..".dat") R[n]=0
fs.remove(n..".dat")
end
end end
delRecord("solo_1")delRecord("solo_2")delRecord("solo_3")delRecord("solo_4")delRecord("solo_5")
delRecord("dig_10")delRecord("dig_40")delRecord("dig_100")delRecord("dig_400")
delRecord("classic_fast")
end end
delRecord("solo_1")delRecord("solo_2")delRecord("solo_3")delRecord("solo_4")delRecord("solo_5")
delRecord("dig_10")delRecord("dig_40")delRecord("dig_100")delRecord("dig_400")
delRecord("classic_fast")
--Try unlock modes which should be unlocked --Try unlock modes which should be unlocked
for name,rank in next,RANKS do for name,rank in next,RANKS do

BIN
media/BGM/sugar fairy.ogg Normal file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More