compute coins value

This commit is contained in:
Fabien Freling 2019-04-28 15:56:06 +02:00
parent e49e42ad34
commit a17da11338

View file

@ -13,11 +13,11 @@ mh=h/s
GameState = { start=0, game=1, gameover=2, market=3 } GameState = { start=0, game=1, gameover=2, market=3 }
currentState = GameState.game currentState = GameState.game
life=100 life=100
coinBlue=5 coinBlue=0
valueBlue=1.0 valueBlue=1.0
coinRed=2 coinRed=0
valueRed=5.0 valueRed=5.0
coinYellow=21 coinYellow=0
valueYellow=0.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
@ -438,6 +438,13 @@ function updateGame()
if coinTimer == 0 then addRandomCoin() end if coinTimer == 0 then addRandomCoin() end
p:direct() p:direct()
p:update() p:update()
-- Coin market
valueBlue=math.floor((math.sin(t/100)+1)*10)/10
if t%60 == 0 then
valueRed=math.random(0,99)/10
end
valueYellow=0.1*coinYellow*coinYellow
end end
function updateMarket() function updateMarket()