Skip to content

Commit 74aaab7

Browse files
committed
exterior阶段光标炫酷重制
1 parent 7a37488 commit 74aaab7

File tree

1 file changed

+55
-14
lines changed

1 file changed

+55
-14
lines changed

assets/progress.lua

Lines changed: 55 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -263,29 +263,70 @@ function PROGRESS.applyEnv(env)
263263
PROGRESS.applyExteriorBG()
264264
PROGRESS.applyExteriorBGM()
265265
function ZENITHA.globalEvent.touchClick(x,y) SYSFX.tap(.26,x,y) end
266+
267+
local rc=.8
268+
local msWidth
269+
local msColor={0,0,0,0}
270+
local msCurve={}
271+
local sin,cos=math.sin,math.cos
272+
local function updateCursor(w)
273+
msWidth=w
274+
msCurve[1],msCurve[2],msCurve[3],msCurve[4],
275+
msCurve[5],msCurve[6],msCurve[7],msCurve[8],
276+
msCurve[9],msCurve[10],msCurve[11],msCurve[12],
277+
msCurve[13],msCurve[14],msCurve[15],msCurve[16],
278+
msCurve[17],msCurve[18],msCurve[19],msCurve[20]
279+
=
280+
00*cos(rc ),00*sin(rc ),
281+
02*cos(rc-w*2.),02*sin(rc-w*2.),
282+
45*cos(rc-w ),45*sin(rc-w ),
283+
46*cos(rc-w*.9),46*sin(rc-w*.9),
284+
45*cos(rc-w*.8),45*sin(rc-w*.8),
285+
30*cos(rc ),30*sin(rc ),
286+
45*cos(rc+w*.8),45*sin(rc+w*.8),
287+
46*cos(rc+w*.9),46*sin(rc+w*.9),
288+
45*cos(rc+w ),45*sin(rc+w ),
289+
02*cos(rc+w*2.),02*sin(rc+w*2.)
290+
end
291+
updateCursor(.55)
266292
function ZENITHA.globalEvent.mouseDown(x,y,k)
267-
if k==1 then SYSFX.ripple(.26,x,y,26,.62,.62,1)
268-
elseif k==2 then SYSFX.ripple(.26,x,y,26,1,.62,1)
293+
msColor[1],msColor[2],msColor[3]=unpack(k==1 and COLOR.lP or k==2 and COLOR.lS or COLOR.lR)
294+
msColor[4]=1
295+
296+
TWEEN.tag_kill('cursor_anim')
297+
local _wid=msWidth
298+
TWEEN.new(function(t) updateCursor(MATH.lerp(_wid,.4,t)) end):setTag('cursor_anim'):setDuration(.0626):run()
299+
TWEEN.tag_kill('cursor_anim2')
300+
301+
if k==1 then SYSFX.ripple(.26,x,y,26,.8,.62,1)
302+
elseif k==2 then SYSFX.ripple(.26,x,y,26,.62,.8,1)
269303
elseif k==3 then SYSFX.ripple(.26,x,y,26,1,.62,.62)
270304
else SYSFX.ripple(.26,x,y,26,9,.9,.9)
271305
end
272306
SFX.play('mouse_down')
273307
end
274308
ZENITHA.globalEvent.mouseMove=NULL
275-
function ZENITHA.globalEvent.mouseUp(x,y,k) SFX.play('mouse_up') end
309+
function ZENITHA.globalEvent.mouseUp(x,y,k)
310+
if not love.mouse.isDown(1,2,3) then
311+
TWEEN.tag_kill('cursor_anim')
312+
local _wid=msWidth
313+
TWEEN.new(function(t) updateCursor(MATH.lerp(_wid,.55,t)) end):setTag('cursor_anim'):setDuration(.0626):run()
314+
TWEEN.new(function(t) msColor[4]=1-t end):setEase('Linear'):setTag('cursor_anim2'):setDuration(1):run()
315+
end
316+
317+
SFX.play('mouse_up')
318+
end
319+
276320
function ZENITHA.globalEvent.drawCursor(x,y)
277321
if not SETTINGS.system.sysCursor then
278-
gc.setColor(1,1,1)
279-
gc.setLineWidth(2)
280-
gc.translate(x,y)
281-
gc.rotate(love.timer.getTime()%MATH.tau)
282-
GC.mRect('line',0,0,20,20)
283-
if love.mouse.isDown(1) then GC.mRect('fill',0,0,8,8) end
284-
if love.mouse.isDown(2) then GC.mRect('line',0,0,12,12) end
285-
if love.mouse.isDown(3) then gc.line(-8,-8,8,8) gc.line(-8,8,8,-8) end
286-
gc.setColor(1,1,1,.626)
287-
gc.line(0,-20,0,20)
288-
gc.line(-20,0,20,0)
322+
GC.translate(x,y)
323+
-- GC.scale(10)
324+
if msColor[4]>0 then
325+
GC.setColor(msColor)
326+
GC.polygon('fill',msCurve)
327+
end
328+
GC.setColor(COLOR.D) GC.setLineWidth(8) GC.polygon('line',msCurve)
329+
GC.setColor(COLOR.L) GC.setLineWidth(2) GC.polygon('line',msCurve)
289330
end
290331
end
291332
ZENITHA.globalEvent.drawSysInfo=sysInfoFunc

0 commit comments

Comments
 (0)