aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main.cpp31
1 files changed, 28 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 74b1adf..3136318 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -35,13 +35,31 @@ int main(void) {
{
break ;
}
+ case (NEXT):
+ {
+ if (IsKeyPressed(KEY_ENTER))
+ {
+ gs = TITLE;
+ std::string next("../meta/maps/");
+ next += game->getNext();
+
+ delete game;
+ if (next != "0") {
+ game = new Game(next);
+ }
+ }
+ break ;
+ }
case (ENDING):
{
if (IsKeyPressed(KEY_ENTER))
{
gs = TITLE;
+ auto next = game->getNext();
delete game;
- game = new Game("../meta/maps/stage_1_start.bfm");
+ if (next != "0") {
+ game = new Game("../meta/maps/stage_1_start.bfm");
+ }
}
break ;
}
@@ -59,12 +77,19 @@ int main(void) {
}
case (GAMEPLAY):
{
- if (game->getKeys()) {
- gs = ENDING;
+ if (auto code = game->getKeys()) {
+ if (code == 1)
+ gs = ENDING;
+ else if (code == 2)
+ gs = NEXT;
}
game->draw();
break ;
}
+ case (NEXT):
+ {
+ break ;
+ }
case (ENDING):
{
DrawCircle(SCREENWIDTH / 2, SCREENHEIGHT / 2, 200, BLACK);