新增spike计数器

This commit is contained in:
MrZ626
2021-05-16 20:29:01 +08:00
parent d7a10c00ed
commit bcb5d3eba4
4 changed files with 21 additions and 3 deletions

View File

@@ -672,14 +672,20 @@ function draw.norm(P)
gc_setStencilTest()
end
--Spike
if P.spikeTime>0 and P.spike>=10 then
gc_setColor(1,1,1,min(P.spikeTime/30,.8))
mDraw(P.spikeText,150,100,nil,min(.3+(P.spike/26)*.4+P.spikeTime/100*.3,1))
end
--Bonus texts
TEXT.draw(P.bonus)
--Display Ys
-- gc_setLineWidth(6)
-- if P.curY then gc_setColor(COLOR.R)gc_line(0,611-P.curY*30,300,610-P.curY*30)end
-- if P.ghoY then gc_setColor(COLOR.G)gc_line(0,615-P.ghoY*30,300,615-P.ghoY*30)end
-- if P.minY then gc_setColor(COLOR.B)gc_line(0,619-P.minY*30,300,620-P.minY*30)end
-- if P.curY then gc_setColor(COLOR.R) gc_line(0,611-P.curY*30,300,610-P.curY*30)end
-- if P.ghoY then gc_setColor(COLOR.G) gc_line(0,615-P.ghoY*30,300,615-P.ghoY*30)end
-- if P.minY then gc_setColor(COLOR.B) gc_line(0,619-P.minY*30,300,620-P.minY*30)end
-- gc_line(0,600-P.garbageBeneath*30,300,600-P.garbageBeneath*30)
gc_pop()

View File

@@ -151,6 +151,8 @@ local function newEmptyPlayer(id,mini)
--Attack-related
P.atkBuffer={}
P.atkBufferSum,P.atkBufferSum1=0,0
P.spike,P.spikeTime=0,0
P.spikeText=love.graphics.newText(getFont(100))
--Attacker-related
P.badge,P.strength=0,0

View File

@@ -1380,6 +1380,13 @@ do--Player.drop(self)--Place piece
self.combo=cmb
--Spike
if atk>0 then
self.spike=self.spikeTime==0 and atk or self.spike+atk
self.spikeText:set(self.spike)
self.spikeTime=min(self.spikeTime+40+atk*5,100)
end
--DropSpeed bonus
if self._20G then
cscore=cscore*2

View File

@@ -12,6 +12,9 @@ local function update_misc(P,dt)
P.finesseComboTime=P.finesseComboTime-1
end
--Update spike counter
if P.spikeTime>0 then P.spikeTime=P.spikeTime-1 end
--Update atkBuffer alert
local t=P.atkBufferSum1
if t<P.atkBufferSum then