Compare commits

...

89 Commits

Author SHA1 Message Date
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
444 changed files with 2824 additions and 1794 deletions

View File

@@ -22,34 +22,13 @@ local BGM={
--suspend=[str:pausing ID]
--playing=[src:playing SRC]
}
BGM.list={
"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
"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.set(L)
BGM.list=L
BGM.len=#L
end
function BGM.loadOne(N)
N=BGM.list[N]
local file="/BGM/"..N..".ogg"
local file="media/BGM/"..N..".ogg"
if love.filesystem.getInfo(file)then
BGM.list[N]=love.audio.newSource(file,"stream")
BGM.list[N]:setLooping(true)

View File

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

View File

@@ -1,19 +1,19 @@
SCR= require("Zframework/screen")
COLOR= require("Zframework/color")
SCN= require("Zframework/scene")
LOG= require("Zframework/log")
require("Zframework/toolfunc")
VIB= require("Zframework/vib")
VIB= require("Zframework/vibrate")
SFX= require("Zframework/sfx")
LIGHT= require("Zframework/light")
SHADER= require("Zframework/shader")
BG= require("Zframework/bg")
BG= require("Zframework/background")
WIDGET= require("Zframework/widget")
TEXT= require("Zframework/text")
sysFX= require("Zframework/sysFX")
SYSFX= require("Zframework/sysFX")
IMG= require("Zframework/img")
IMG= require("Zframework/image")
BGM= require("Zframework/bgm")
VOC= require("Zframework/voice")
@@ -58,14 +58,14 @@ local function updatePowerInfo()
end
gc.rectangle("fill",76,6,pow*.22,14)
if pow<100 then
setFont(14)
setFont(15)
gc.setColor(0,0,0)
gc.print(pow,77,2)
gc.print(pow,77,4)
gc.print(pow,79,2)
gc.print(pow,79,4)
gc.print(pow,77,1)
gc.print(pow,77,3)
gc.print(pow,79,1)
gc.print(pow,79,3)
gc.setColor(1,1,1)
gc.print(pow,78,3)
gc.print(pow,78,2)
end
end
gc.draw(IMG.batteryImage,73,3)
@@ -94,7 +94,10 @@ function love.mousepressed(x,y,k,touch)
if touch then return end
mouseShow=true
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 mouseDown[SCN.cur]then
mouseDown[SCN.cur](mx,my,k)
@@ -105,7 +108,7 @@ function love.mousepressed(x,y,k,touch)
WIDGET.press(mx,my)
end
lastX,lastY=mx,my
sysFX.newRipple(.3,mx,my,30)
SYSFX.newRipple(.3,mx,my,30)
end
function love.mousemoved(x,y,dx,dy,t)
if t then return end
@@ -188,7 +191,7 @@ function love.touchreleased(id,x,y)
if touchClick[SCN.cur]then
touchClick[SCN.cur](x,y)
end
sysFX.newRipple(.3,x,y,30)
SYSFX.newRipple(.3,x,y,30)
end
end
@@ -303,7 +306,7 @@ function love.gamepadpressed(_,i)
if gamepadDown[SCN.cur]then gamepadDown[SCN.cur](i)
elseif keyDown[SCN.cur]then keyDown[SCN.cur](keyMirror[i]or i)
elseif i=="back"then SCN.back()
else WIDGET.gamepadPressed(i)
else WIDGET.gamepadPressed(keyMirror[i]or i)
end
end
function love.gamepadreleased(_,i)
@@ -501,7 +504,7 @@ function love.run()
TASK.update()
VOC.update()
BG.update(dt)
sysFX.update(dt)
SYSFX.update(dt)
TEXT.update()
_=Tmr[SCN.cur]if _ then _(dt)end--Scene Updater
if SCN.swapping then SCN.swapUpdate()end--Scene swapping animation
@@ -513,9 +516,10 @@ function love.run()
FCT=FCT+SETTING.frameMul
if FCT>=100 then
FCT=FCT-100
DISCARD()--SPEED UPUPUP!
--Draw background
BG.draw()
gc.push("transform")
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)gc.circle("fill",mx,my,3)
end
sysFX.draw()
SYSFX.draw()
TEXT.draw()
gc.pop()
@@ -584,6 +588,7 @@ function love.run()
LOG.draw()
PRESENT()
DISCARD()--SPEED UPUPUP!
end
end

View File

@@ -1,11 +1,11 @@
local langList={
require("LANG/lang_zh"),
require("LANG/lang_zh2"),
require("LANG/lang_en"),
require("LANG/lang_fr"),
require("LANG/lang_sp"),
require("LANG/lang_symbol"),
require("LANG/lang_yygq"),
require("parts/language/lang_zh"),
require("parts/language/lang_zh2"),
require("parts/language/lang_en"),
require("parts/language/lang_fr"),
require("parts/language/lang_sp"),
require("parts/language/lang_symbol"),
require("parts/language/lang_yygq"),
--Add new language file to LANG folder. Attention, new language won't show in-game when you add language
}
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:
--https://github.com/mattdesl/lwjgl-basics/wiki/2D-Pixel-Perfect-Shadows
local gc=love.graphics
local C=gc.clear
local shadowMapShader=gc.newShader("Zframework/shader/shadowMap.glsl")--Shader for caculating the 1D shadow map.
local lightRenderShader=gc.newShader("Zframework/shader/lightRender.glsl")--Shader for rendering blurred lights and shadows.
local clear,translate=gc.clear,gc.translate
local setCanvas,setShader=gc.setCanvas,gc.setShader
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 function move(L,x,y)
L.x,L.y=x,y
@@ -20,9 +23,9 @@ end
local function draw(L)
--Initialization
local r,g,b,a=love.graphics.getColor()
gc.setCanvas(L.blackCanvas)C()
gc.setCanvas(L.shadowCanvas)C()
gc.setCanvas(L.renderCanvas)C()
setCanvas(L.blackCanvas)clear()
setCanvas(L.shadowCanvas)clear()
setCanvas(L.renderCanvas)clear()
lightRenderShader:send("xresolution",L.size)
shadowMapShader:send("yresolution",L.size)
@@ -31,26 +34,26 @@ local function draw(L)
local Y=L.y-L.size*.5
--Render solid
gc.translate(-X,-Y)
translate(-X,-Y)
L.blackCanvas:renderTo(L.blackFn)
gc.translate(X,Y)
translate(X,Y)
--Render shade canvas by solid
gc.setShader(shadowMapShader)
gc.setCanvas(L.shadowCanvas)
gc.draw(L.blackCanvas)
setShader(shadowMapShader)
setCanvas(L.shadowCanvas)
render(L.blackCanvas)
--Render light canvas by shade
gc.setShader(lightRenderShader)
gc.setCanvas(L.renderCanvas)
gc.draw(L.shadowCanvas,0,0,0,1,L.size)
setShader(lightRenderShader)
setCanvas(L.renderCanvas)
render(L.shadowCanvas,0,0,0,1,L.size)
--Ready to final render
gc.setShader()gc.setCanvas()gc.setBlendMode("add")
setShader()setCanvas()gc.setBlendMode("add")
--Render to screes
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
gc.setBlendMode("alpha")
@@ -71,7 +74,6 @@ end
function LIGHT.add(x,y,R,F)
local id=#Lights+1
Lights[id]={
--Methods
id=id,
x=x,y=y,size=R,
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
blackFn=F,--Solid draw funcion
move=move,
setPow=setPow,
draw=draw,

View File

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

@@ -79,21 +79,21 @@ function FXdraw.shade(S)
gc.rectangle("fill",S.x,S.y,S.w,S.h,2)
end
local sysFX={}
function sysFX.update(dt)
local SYSFX={}
function SYSFX.update(dt)
for i=#fx,1,-1 do
if fx[i]:update(dt) then
rem(fx,i)
end
end
end
function sysFX.draw()
function SYSFX.draw()
for i=1,#fx do
fx[i]:draw()
end
end
function sysFX.newBadge(x1,y1,x2,y2)
function SYSFX.newBadge(x1,y1,x2,y2)
fx[#fx+1]={
update=FXupdate.badge,
draw=FXdraw.badge,
@@ -103,7 +103,7 @@ function sysFX.newBadge(x1,y1,x2,y2)
x2=x2,y2=y2,
}
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]={
update=FXupdate.attack,
draw=FXdraw.attack,
@@ -115,7 +115,7 @@ function sysFX.newAttack(rate,x1,y1,x2,y2,wid,r,g,b,a)
r=r,g=g,b=b,a=a,
}
end
function sysFX.newRipple(duration,x,y,r)
function SYSFX.newRipple(duration,x,y,r)
fx[#fx+1]={
update=FXupdate.ripple,
draw=FXdraw.ripple,
@@ -124,7 +124,7 @@ function sysFX.newRipple(duration,x,y,r)
x=x,y=y,r=r,
}
end
function sysFX.newRectRipple(duration,x,y,w,h)
function SYSFX.newRectRipple(duration,x,y,w,h)
fx[#fx+1]={
update=FXupdate.rectRipple,
draw=FXdraw.rectRipple,
@@ -133,7 +133,7 @@ function sysFX.newRectRipple(duration,x,y,w,h)
x=x,y=y,w=w,h=h,
}
end
function sysFX.newShade(duration,r,g,b,x,y,w,h)
function SYSFX.newShade(duration,r,g,b,x,y,w,h)
fx[#fx+1]={
update=FXupdate.shade,
draw=FXdraw.shade,
@@ -143,4 +143,4 @@ function sysFX.newShade(duration,r,g,b,x,y,w,h)
x=x,y=y,w=w,h=h,
}
end
return sysFX
return SYSFX

View File

@@ -3,25 +3,21 @@ local rem=table.remove
local voiceQueue={free=0}
local bank={}--{vocName1={SRC1s},vocName2={SRC2s},...}
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={}
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
bank[vocName]={love.audio.newSource(fileName,"static")}
table.insert(VOC.list[N],vocName)
return true
end
end
function VOC.set(L)
VOC.name=L
VOC.len=#L
end
function VOC.loadOne(name)
local N=VOC.name[name]
VOC.list[N]={}

View File

@@ -19,6 +19,7 @@ local widgetMetatable={
local text={
type="text",
alpha=0,
}
function text:reset()
if type(self.text)=="string"then
@@ -29,14 +30,26 @@ function text:reset()
self.font=self.font-10
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()
gc.setColor(self.color)
if self.align=="M"then
gc.draw(self.text,self.x-self.text:getWidth()*.5,self.y)
elseif self.align=="L"then
gc.draw(self.text,self.x,self.y)
elseif self.align=="R"then
gc.draw(self.text,self.x-self.text:getWidth(),self.y)
if self.alpha>0 then
local c=self.color
gc.setColor(c[1],c[2],c[3],self.alpha)
if self.align=="M"then
gc.draw(self.text,self.x-self.text:getWidth()*.5,self.y)
elseif self.align=="L"then
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
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,
font= D.font or 30,
align= D.align or"M",
hide= D.hide,
hideCon=D.hide,
}
for k,v in next,text do _[k]=v end
if not _.hideCon then _.alpha=1 end
setmetatable(_,widgetMetatable)
return _
end
@@ -102,7 +116,7 @@ function button:getCenter()
end
function button:FX()
local ATV=self.ATV
sysFX.newRectRipple(
SYSFX.newRectRipple(
.16,
self.x-ATV,
self.y-ATV,
@@ -145,6 +159,11 @@ end
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)
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]
if not D.h then D.h=D.w end
local _={
@@ -220,6 +239,9 @@ end
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)
end
function key:press()
self.code()
end
function WIDGET.newKey(D)--name,x,y,w[,h][,color][,font],code[,hide]
if not D.h then D.h=D.w end
local _={
@@ -304,6 +326,10 @@ end
function switch:getInfo()
return format("x=%d,y=%d,font=%d",self.x,self.y,self.font)
end
function switch:press()
self.code()
SFX.play("move")
end
function WIDGET.newSwitch(D)--name,x,y[,font][,disp],code,hide
local _={
name= D.name,
@@ -423,6 +449,37 @@ end
function slider:getInfo()
return format("x=%d,y=%d,w=%d",self.x,self.y,self.w)
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
local _={
name= D.name,
@@ -542,7 +599,7 @@ function selector:draw()
end
--Text
setFont(28)
setFont(30)
t=self.text
if t then
gc.setColor(r,g,b)
@@ -554,6 +611,43 @@ end
function selector:getInfo()
return format("x=%d,y=%d,w=%d",self.x+self.w*.5,self.y+30,self.w)
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
local _={
name= D.name,
@@ -643,6 +737,27 @@ end
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)
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
local _={
name= D.name,
@@ -741,43 +856,10 @@ end
function WIDGET.press(x,y)
local W=WIDGET.sel
if not W then return end
if W.type=="button"then
W.code()
W:FX()
SFX.play("button")
elseif W.type=="key"then
W.code()
elseif W.type=="switch"then
W.code()
SFX.play("move")
if W.type=="button"or W.type=="key"or W.type=="switch"or W.type=="selector"or W.type=="textBox"then
W:press(x,y)
elseif W.type=="slider"then
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
if W.hide and W.hide()then WIDGET.sel=nil end
end
@@ -785,20 +867,7 @@ function WIDGET.drag(x,y)
local W=WIDGET.sel
if not W then return end
if W.type=="slider"then
if not x then return end
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
W:drag(x,y)
elseif not W:isAbove(x,y)then
WIDGET.sel=nil
end
@@ -807,44 +876,19 @@ function WIDGET.release(x,y)
local W=WIDGET.sel
if not W then return end
if W.type=="slider"then
W.lastTime=0
WIDGET.drag(x,y)
W:release(x,y)
end
end
function WIDGET.keyPressed(key)
if key=="space"or key=="return"then
function WIDGET.keyPressed(k)
if k=="space"or k=="return"then
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
local W=WIDGET.sel
if not W then return end
local isLeft=key=="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")
if W and W.type=="slider"or W.type=="selector"then
W:arrowKey(k=="left")
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
for _,v in next,WIDGET.active do
if v.isAbove then
@@ -857,10 +901,10 @@ function WIDGET.keyPressed(key)
local W=WIDGET.sel
if not W.getCenter then return end
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 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
for _,W1 in ipairs(WIDGET.active)do
if W~=W1 and W1.resCtr then
@@ -882,20 +926,11 @@ function WIDGET.keyPressed(key)
if tar then
WIDGET.sel=tar
end
elseif WIDGET.sel and WIDGET.sel.type=="textBox"then
local t=WIDGET.sel.value
if #t==0 then return end
if key=="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 key=="delete"then
t=""
SFX.play("hold")
else
local W=WIDGET.sel
if W and W.type=="textBox"then
W:keypress(k)
end
WIDGET.sel.value=t
end
end
local keyMirror={

View File

@@ -1,4 +1,4 @@
VERSION="Alpha V0.12.0"
VERSION="Alpha V0.12.2"
love.setDeprecationOutput(false)
function love.conf(t)
t.identity="Techmino"--Saving folder
@@ -6,11 +6,14 @@ function love.conf(t)
t.gammacorrect=false
t.appendidentity=true--Search files in source then in save directory
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
W.title="Techmino "..VERSION
W.icon="/image/icon.png"
W.icon="media/image/icon.png"
W.width,W.height=1280,720
W.minwidth,W.minheight=640,360
W.borderless=false

173
main.lua
View File

@@ -29,98 +29,14 @@ love.keyboard.setKeyRepeat(true)
love.keyboard.setTextInput(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
require("Zframework")
require("parts/list")
require("parts/default_data")
require("parts/globalTables")
require("parts/gametoolfunc")
SCR.setSize(1280,720)--Initialize Screen size
FIELD[1]=newBoard()--Initialize field[1]
BLOCKS= require("parts/mino")
@@ -134,6 +50,75 @@ AIFUNC= require("parts/ai")
MODES= require("parts/modes")
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
for _,v in next,love.filesystem.getDirectoryItems("parts/backgrounds")do
if love.filesystem.getRealDirectory("parts/backgrounds/"..v)~=SAVEDIR then
@@ -216,15 +201,17 @@ do
S.version=VERSION
newVersionLaunch=true
local function delRecord(n)
if R[n]then
R[n]=0
fs.remove(n..".dat")
if not VERSION:find("0.12")or VERSION:find("0.12.0")then
local function delRecord(n)
if R[n]then
R[n]=0
fs.remove(n..".dat")
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
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
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