From 3db348d4d3b36a7fd7617253a3257189df7ba461 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Sun, 28 Apr 2019 18:04:44 +0200 Subject: [PATCH] enter hospital --- right_coin.lua | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/right_coin.lua b/right_coin.lua index 6128361..4c06391 100644 --- a/right_coin.lua +++ b/right_coin.lua @@ -429,17 +429,20 @@ function updateGame() if t%20 ==0 then life=life-1 end - if btnp(4) then -- A (Z key) - currentState = GameState.market - end - if btnp(5) then -- B (X key) - currentState = GameState.gameover - end - if coinTimer>0 then coinTimer=coinTimer-1 end - if coinTimer == 0 then addRandomCoin() end p:direct() p:update() + if mget(p.x/s,p.y/s) == 48 or mget(p.x/s,p.y/s) == 49 then + if btnp(4) then -- A (Z key) + currentState = GameState.market + 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 addRandomCoin() end + -- Coin market valueBlue=math.floor((math.sin(t/200)+1)*50)/10 if t%60 == 0 then