make life deadlier
This commit is contained in:
parent
5bbf5c1768
commit
361dcb7d0f
|
@ -22,6 +22,8 @@ valueYellow=0.8
|
||||||
MarketOptions = { blue=0, red=1, yellow=2, all=3, done=4 }
|
MarketOptions = { blue=0, red=1, yellow=2, all=3, done=4 }
|
||||||
marketSelection = MarketOptions.blue
|
marketSelection = MarketOptions.blue
|
||||||
secondsAlive=0
|
secondsAlive=0
|
||||||
|
sickCounter=20 -- how many seconds before the sickness get stronger?
|
||||||
|
sickLapse=20 -- how many ticks before the life decreases?
|
||||||
|
|
||||||
solids={}
|
solids={}
|
||||||
do
|
do
|
||||||
|
@ -519,12 +521,18 @@ function updateGame()
|
||||||
currentState = GameState.gameover
|
currentState = GameState.gameover
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if t%20 == 0 then
|
if t%sickLapse == 0 then
|
||||||
life=life-1
|
life=life-1
|
||||||
end
|
end
|
||||||
if t%60 == 0 then
|
if t%60 == 0 then
|
||||||
|
sickCounter = sickCounter - 1
|
||||||
secondsAlive = secondsAlive + 1
|
secondsAlive = secondsAlive + 1
|
||||||
end
|
end
|
||||||
|
if sickCounter==0 and sickLapse>3 then
|
||||||
|
sickLapse=sickLapse-2
|
||||||
|
sickCounter=20
|
||||||
|
end
|
||||||
|
|
||||||
p:direct()
|
p:direct()
|
||||||
p:update()
|
p:update()
|
||||||
|
|
||||||
|
@ -534,9 +542,6 @@ function updateGame()
|
||||||
currentState = GameState.market
|
currentState = GameState.market
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- if btnp(5) then -- B (X key)
|
|
||||||
-- currentState = GameState.gameover
|
|
||||||
-- end
|
|
||||||
if coinTimer>0 then coinTimer=coinTimer-1 end
|
if coinTimer>0 then coinTimer=coinTimer-1 end
|
||||||
if coinTimer == 0 then
|
if coinTimer == 0 then
|
||||||
for i=1, coinSpawnCount do
|
for i=1, coinSpawnCount do
|
||||||
|
@ -544,12 +549,12 @@ function updateGame()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Coin market
|
-- Coin market, capped to 9.9
|
||||||
valueBlue=math.floor((math.sin(t/200)+1)*50)/10
|
valueBlue=math.floor((math.sin(t/200)+1)*50)/10
|
||||||
if t%60 == 0 then
|
if t%60 == 0 then
|
||||||
valueRed=math.random(0,99)/10
|
valueRed=math.random(0,99)/10
|
||||||
end
|
end
|
||||||
valueYellow=0.1*coinYellow*coinYellow
|
valueYellow=math.min(.1*coinYellow*coinYellow, 9.9)
|
||||||
end
|
end
|
||||||
|
|
||||||
function updateMarket()
|
function updateMarket()
|
||||||
|
|
Loading…
Reference in a new issue