diff --git a/README.md b/README.md index d4aa63a..dd6040e 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Limitation: the player must cheat - [ ] game over & restart - [ ] sound effects - [ ] background music -- [ ] score overlay +- [X] score overlay - [ ] stage 1 - [ ] stage ending - [ ] win state diff --git a/chi-tor.wren b/chi-tor.wren index 75b89b6..922b90e 100644 --- a/chi-tor.wren +++ b/chi-tor.wren @@ -510,7 +510,8 @@ class Game is TIC{ } OVR() { - if (Game.state == Game.game) { + if (Game.state == Game.game || + Game.state == Game.gameover) { TIC.print("SCORE: %(__score)", 0, 0, Color.white, true) TIC.print("GOAL: 12", 120, 0, Color.white, true) } @@ -529,6 +530,13 @@ class Game is TIC{ _p_index = 0 } + } else if (Game.state == Game.gameover) { + if (TIC.btnp(4)) { + _world = World.new() + __state = Game.game + } + + } else if (Game.state == Game.pause) { if (TIC.btnp(5)) { __state = Game.game @@ -585,6 +593,9 @@ class Game is TIC{ } else if (Game.state == Game.game) { _world.draw() + } else if (Game.state == Game.gameover) { + _world.draw() + } else if (Game.state == Game.pause) { TIC.print("PAUSE", 90, H/4, Color.white, false, 2)