Skip to content

Commit

Permalink
框架跟进+修一些相关bug
Browse files Browse the repository at this point in the history
  • Loading branch information
MrZ626 committed Jun 3, 2024
1 parent e2bc29a commit 968f76b
Show file tree
Hide file tree
Showing 22 changed files with 274 additions and 261 deletions.
2 changes: 1 addition & 1 deletion Zenitha
Submodule Zenitha updated 37 files
+8 −8 background.lua
+15 −15 bgm.lua
+35 −1 color.lua
+2 −2 debug.lua
+2 −4 file.lua
+1 −1 font.lua
+131 −8 gcExtend.lua
+19 −10 http.lua
+1 −1 image.lua
+722 −385 init.lua
+3 −3 log.lua
+15 −15 luasocket_doc.lua
+74 −22 mathExtend.lua
+6 −6 message.lua
+10 −5 midi.lua
+ mono.ttf
+ norm.ttf
+2 −3 profile.lua
+6 −1 require.lua
+35 −28 scene.lua
+12 −13 scene/console.lua
+3 −1 scene/demo.lua
+15 −14 scene/test.lua
+52 −61 screen.lua
+46 −46 sfx.lua
+36 −16 stringExtend.lua
+183 −165 sysFX.lua
+397 −280 tableExtend.lua
+6 −1 task.lua
+244 −34 tcp.lua
+41 −24 tcp_client.lua
+254 −73 tcp_server.lua
+7 −6 text.lua
+381 −0 tween.lua
+3 −3 voice.lua
+14 −14 wait.lua
+111 −121 widget.lua
2 changes: 1 addition & 1 deletion assets/background/space.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ local stars
local W,H
function back.init()
stars={}
BG.resize(SCR.w,SCR.h)
BG._resize(SCR.w,SCR.h)
end
function back.resize(w,h)
W,H=w+20,h+20
Expand Down
15 changes: 9 additions & 6 deletions assets/gameFuncs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,18 @@ function saveSettings()
end
function applyFPS(inGame)
if inGame then
Zenitha.setMaxFPS(SETTINGS.maxFPS)
Zenitha.setUpdateFreq(SETTINGS.updRate)
Zenitha.setDrawFreq(SETTINGS.drawRate)
ZENITHA.setMaxFPS(SETTINGS.maxFPS)
ZENITHA.setUpdateFreq(SETTINGS.updRate)
ZENITHA.setDrawFreq(SETTINGS.drawRate)
else
Zenitha.setMaxFPS(math.min(SETTINGS.maxFPS,90))
Zenitha.setUpdateFreq(100)
Zenitha.setDrawFreq(100)
ZENITHA.setMaxFPS(math.min(SETTINGS.maxFPS,90))
ZENITHA.setUpdateFreq(100)
ZENITHA.setDrawFreq(100)
end
end
function applyClickFX(flag)
ZENITHA.globalEvent.clickFX=flag and function(x,y) SYSFX.tap(.26,x,y) end or NULL
end



Expand Down
14 changes: 7 additions & 7 deletions assets/gameTables.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ do
'math','string','table',
'bit','coroutine',
'MATH','STRING','TABLE',
} do TABLE.complete(_G[v],mapScriptEnv[v]) end
} do TABLE.updateMissing(_G[v],mapScriptEnv[v]) end
mapScriptEnv.string.dump=nil
local dangerousLibMeta={__index=function() error("No way.") end}
for _,v in next,{
Expand Down Expand Up @@ -186,7 +186,7 @@ do-- Userdata tables
KEY_MAP_inv={-- Function-Keys map, for show key name
_update=function(self)
local _f=self._update
TABLE.clear(self)
TABLE.clearAll(self)
self._update=_f
for k,v in next,KEY_MAP do
self[v]=k
Expand Down Expand Up @@ -265,12 +265,12 @@ do-- Userdata tables

-- Video
fullscreen= function(v) love.window.setFullscreen(v) love.resize(love.graphics.getWidth(),love.graphics.getHeight()) end,
maxFPS= function(v) Zenitha.setMaxFPS(v) end,
updRate= function(v) Zenitha.setUpdateFreq(v) end,
drawRate= function(v) Zenitha.setDrawFreq(v) end,
maxFPS= function(v) ZENITHA.setMaxFPS(v) end,
updRate= function(v) ZENITHA.setUpdateFreq(v) end,
drawRate= function(v) ZENITHA.setDrawFreq(v) end,
sysCursor= function(v) love.mouse.setVisible(v) end,
clickFX= function(v) Zenitha.setClickFX(v) end,
clean= function(v) Zenitha.setCleanCanvas(v) end,
clickFX= function(v) applyClickFX(v) end,
clean= function(v) ZENITHA.setCleanCanvas(v) end,

-- Other
locale= function(v) Text=LANG.get(v) LANG.setTextFuncSrc(Text) end,
Expand Down
48 changes: 24 additions & 24 deletions assets/level/Rage Beneath the Mountains/script.lua
Original file line number Diff line number Diff line change
Expand Up @@ -165,44 +165,44 @@ end
function init()
for _,note in next,game.map.noteQueue do
if type(note)=='table' and note.track>=1 and note.track<=4 then
local oAnim=TABLE.copy(objTemplate)
local oAnim=TABLE.copyAll(objTemplate)
local oAnimTime=note.time
oAnim.life=0.5
oAnim.x=290+140*note.track
oAnim.y=668
oAnim.drawFront=objAnimDefault
ins(events,{time=oAnimTime,func=objCreate,arg=TABLE.copy(oAnim)})
ins(events,{time=oAnimTime,func=objCreate,arg=TABLE.copyAll(oAnim)})
end
if elementB==true and type(note)=='table' and note.track>=17 and note.track<=20 then
local oAnim=TABLE.copy(objTemplate)
local oAnim=TABLE.copyAll(objTemplate)
local oAnimTime=note.time
oAnim.life=0.5
oAnim.x=-1950+140*note.track
oAnim.y=668
oAnim.drawFront=objAnimDefault
ins(events,{time=oAnimTime,func=objCreate,arg=TABLE.copy(oAnim)})
ins(events,{time=oAnimTime,func=objCreate,arg=TABLE.copyAll(oAnim)})
end
if elementB==false and type(note)=='table' and note.track>=9 and note.track<=12 then
local oAnim=TABLE.copy(objTemplate)
local oAnim=TABLE.copyAll(objTemplate)
local oAnimTime=note.time
oAnim.life=0.5
oAnim.x=-830+140*note.track
oAnim.y=668
oAnim.drawFront=objAnimDefault
ins(events,{time=oAnimTime,func=objCreate,arg=TABLE.copy(oAnim)})
ins(events,{time=oAnimTime,func=objCreate,arg=TABLE.copyAll(oAnim)})
end
if elementB==false and type(note)=='table' and note.track>=13 and note.track<=16 then
local oAnim=TABLE.copy(objTemplate)
local oAnim=TABLE.copyAll(objTemplate)
local oAnimTime=note.time
oAnim.life=0.5
oAnim.x=-1390+140*note.track
oAnim.y=668
oAnim.drawFront=objAnimDefault
ins(events,{time=oAnimTime,func=objCreate,arg=TABLE.copy(oAnim)})
ins(events,{time=oAnimTime,func=objCreate,arg=TABLE.copyAll(oAnim)})
end
end

local o=TABLE.copy(objTemplate)
local o=TABLE.copyAll(objTemplate)
o.drawFront=objDrawText
o.x,o.y=0,150
o.life=5.294
Expand All @@ -212,21 +212,21 @@ function init()
if type(note)=='table' and note.track>=5 and note.track<=8 then
note.color=colorFire
note.yOffset=offsetFire
local oAnim=TABLE.copy(objTemplate)
local oAnim=TABLE.copyAll(objTemplate)
local oAnimTime=note.time
oAnim.life=0.5
oAnim.x=-270+140*note.track
oAnim.y=668
oAnim.drawFront=objAnimFire
ins(events,{time=oAnimTime,func=objCreate,arg=TABLE.copy(oAnim)})
ins(events,{time=oAnimTime,func=objCreate,arg=TABLE.copyAll(oAnim)})
for _=1,math.floor(6+8*rnd()) do
oAnim.life=0.1+0.4*rnd()
oAnim.x=-270+140*note.track-55+rnd()*110
oAnim.y=668-12+rnd()*24
oAnim.drawFront=objPartFire
oAnim.direction=math.atan2(oAnim.y-668,oAnim.x-(140*note.track-270))-30+60*rnd()
oAnim.speed=72+rnd()*48
ins(events,{time=oAnimTime,func=objCreate,arg=TABLE.copy(oAnim)})
ins(events,{time=oAnimTime,func=objCreate,arg=TABLE.copyAll(oAnim)})
end
end
end
Expand All @@ -245,21 +245,21 @@ function init()
if type(note)=='table' and note.track>=5 and note.track<=8 then
note.color=colorWater
note.yOffset=offsetWater
local oAnim=TABLE.copy(objTemplate)
local oAnim=TABLE.copyAll(objTemplate)
local oAnimTime=note.time
oAnim.life=0.5
oAnim.x=-270+140*note.track
oAnim.y=668
oAnim.drawFront=objAnimWater
ins(events,{time=oAnimTime,func=objCreate,arg=TABLE.copy(oAnim)})
ins(events,{time=oAnimTime,func=objCreate,arg=TABLE.copyAll(oAnim)})
for _=1,math.floor(6+8*rnd()) do
oAnim.life=0.1+0.4*rnd()
oAnim.x=-270+140*note.track-55+rnd()*110
oAnim.y=668-12+rnd()*24
oAnim.drawFront=objPartWater
oAnim.xspeed=-8+rnd()*16
oAnim.yspeed=-36-rnd()*24
ins(events,{time=oAnimTime,func=objCreate,arg=TABLE.copy(oAnim)})
ins(events,{time=oAnimTime,func=objCreate,arg=TABLE.copyAll(oAnim)})
end
end
end
Expand All @@ -273,29 +273,29 @@ function init()
}
end
end
ins(events,{time=72.701,func=objCreate,arg=TABLE.copy(o)})
ins(events,{time=72.701,func=objCreate,arg=TABLE.copyAll(o)})
if elementB then
o.text={"若陀龙王即将汲取雷元素的力量…","附着雷元素的音符需要在一拍后重复击打!"}
for _,note in next,game.map.noteQueue do
if type(note)=='table' and note.track>=9 and note.track<=12 then
note.color=colorThunder
local oAnim=TABLE.copy(objTemplate)
local oAnim=TABLE.copyAll(objTemplate)
local oAnimTime=note.time
oAnim.life=0.441
oAnim.x=-830+140*note.track
oAnim.y=668
oAnim.drawFront=objAnimThunderA
ins(events,{time=oAnimTime,func=objCreate,arg=TABLE.copy(oAnim)})
ins(events,{time=oAnimTime,func=objCreate,arg=TABLE.copyAll(oAnim)})
oAnim.drawFront=objAnimThunderB
ins(events,{time=oAnimTime+0.441,func=objCreate,arg=TABLE.copy(oAnim)})
ins(events,{time=oAnimTime+0.441,func=objCreate,arg=TABLE.copyAll(oAnim)})
for _=1,math.floor(6+8*rnd()) do
oAnim.life=0.1+0.4*rnd()
oAnim.x=-830+140*note.track-55+rnd()*110
oAnim.y=668-12+rnd()*24
oAnim.xOffset=-12+rnd()*24
oAnim.yOffset=-12+rnd()*24
oAnim.drawFront=objPartThunder
ins(events,{time=oAnimTime+0.441,func=objCreate,arg=TABLE.copy(oAnim)})
ins(events,{time=oAnimTime+0.441,func=objCreate,arg=TABLE.copyAll(oAnim)})
end
elseif type(note)=='table' and note.track>=13 and note.track<=16 then
note.xOffset=offsetThunder
Expand All @@ -316,13 +316,13 @@ function init()
if type(note)=='table' and note.track>=17 and note.track<=20 then
note.color=colorIce
note.xOffset=offsetIce[2-note.track%2]
local oAnim=TABLE.copy(objTemplate)
local oAnim=TABLE.copyAll(objTemplate)
local oAnimTime=note.time
oAnim.life=0.5
oAnim.x=-1950+140*note.track
oAnim.y=668
oAnim.drawFront=objAnimIce
ins(events,{time=oAnimTime,func=objCreate,arg=TABLE.copy(oAnim)})
ins(events,{time=oAnimTime,func=objCreate,arg=TABLE.copyAll(oAnim)})
for _=1,math.floor(6+8*rnd()) do
oAnim.life=0.1+0.4*rnd()
oAnim.x=-1950+140*note.track-55+rnd()*110
Expand All @@ -331,7 +331,7 @@ function init()
oAnim.speed=6+rnd()*15
oAnim.scale=1+rnd()*4
oAnim.drawFront=objPartIce
ins(events,{time=oAnimTime,func=objCreate,arg=TABLE.copy(oAnim)})
ins(events,{time=oAnimTime,func=objCreate,arg=TABLE.copyAll(oAnim)})
end
end
end
Expand All @@ -345,7 +345,7 @@ function init()
}
end
end
ins(events,{time=115.054,func=objCreate,arg=TABLE.copy(o)})
ins(events,{time=115.054,func=objCreate,arg=TABLE.copyAll(o)})
for _,note in next,game.map.noteQueue do
if type(note)=='table' then
note.track=(note.track-1)%4+1
Expand Down
Loading

0 comments on commit 968f76b

Please sign in to comment.