diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2016-02-09 23:30:11 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2016-02-09 23:30:11 +0100 |
commit | 359b87fa8bd3a77dc097c1c125c5b3e7cc9b43ee (patch) | |
tree | bd5ec5e977556a66dc012e3f972bc32563f91161 /core/src/ch/asynk/rustanddust/menu | |
parent | fd124f484050ae6ba75554e7398650b62b90b314 (diff) | |
download | RustAndDust-359b87fa8bd3a77dc097c1c125c5b3e7cc9b43ee.zip RustAndDust-359b87fa8bd3a77dc097c1c125c5b3e7cc9b43ee.tar.gz |
MainMenu: rely on Menu.hit()
Diffstat (limited to 'core/src/ch/asynk/rustanddust/menu')
-rw-r--r-- | core/src/ch/asynk/rustanddust/menu/MainMenu.java | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/core/src/ch/asynk/rustanddust/menu/MainMenu.java b/core/src/ch/asynk/rustanddust/menu/MainMenu.java index ff14959..b43f76d 100644 --- a/core/src/ch/asynk/rustanddust/menu/MainMenu.java +++ b/core/src/ch/asynk/rustanddust/menu/MainMenu.java @@ -48,24 +48,14 @@ public class MainMenu extends Menu @Override public boolean hit(float x, float y) { - boolean ret = false; menuItem = Items.NONE; - if (!visible) return ret; + if (!visible) return false; - if (label(Items.PLAY).hit(x, y)) { - menuItem = Items.PLAY; - ret = true; - } else if (label(Items.TUTORIALS).hit(x, y)) { - menuItem = Items.TUTORIALS; - ret = true; - } else if (label(Items.OPTIONS).hit(x, y)) { - menuItem = Items.OPTIONS; - ret = true; - } else if (label(Items.EXIT).hit(x, y)) { - Gdx.app.exit(); - } + if (!super.hit(x, y)) return false; - return ret; + if (menuItem == Items.EXIT) + Gdx.app.exit(); + return true; } } |