compute coins value

master
Fabien Freling 2019-04-28 15:56:06 +02:00
parent e49e42ad34
commit a17da11338
1 changed files with 10 additions and 3 deletions

View File

@ -13,11 +13,11 @@ mh=h/s
GameState = { start=0, game=1, gameover=2, market=3 }
currentState = GameState.game
life=100
coinBlue=5
coinBlue=0
valueBlue=1.0
coinRed=2
coinRed=0
valueRed=5.0
coinYellow=21
coinYellow=0
valueYellow=0.8
MarketOptions = { blue=0, red=1, yellow=2, all=3, done=4 }
marketSelection = MarketOptions.blue
@ -438,6 +438,13 @@ function updateGame()
if coinTimer == 0 then addRandomCoin() end
p:direct()
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
function updateMarket()