diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6dd29b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +bin/ \ No newline at end of file diff --git a/bin/game b/bin/game deleted file mode 100755 index 3607854..0000000 Binary files a/bin/game and /dev/null differ diff --git a/bin/game.dSYM/Contents/Info.plist b/bin/game.dSYM/Contents/Info.plist deleted file mode 100644 index 4e06fe6..0000000 --- a/bin/game.dSYM/Contents/Info.plist +++ /dev/null @@ -1,20 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleIdentifier - com.apple.xcode.dsym.game - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - dSYM - CFBundleSignature - ???? - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/bin/game.dSYM/Contents/Resources/DWARF/game b/bin/game.dSYM/Contents/Resources/DWARF/game deleted file mode 100644 index 63028c3..0000000 Binary files a/bin/game.dSYM/Contents/Resources/DWARF/game and /dev/null differ diff --git a/bin/game.dSYM/Contents/Resources/Relocations/aarch64/game.yml b/bin/game.dSYM/Contents/Resources/Relocations/aarch64/game.yml deleted file mode 100644 index 0e63948..0000000 --- a/bin/game.dSYM/Contents/Resources/Relocations/aarch64/game.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -triple: 'arm64-apple-darwin' -binary-path: 'bin/game' -relocations: [] -... diff --git a/src/game/game.h b/src/game/game.h index ed4f5a4..aa8f47b 100644 --- a/src/game/game.h +++ b/src/game/game.h @@ -66,7 +66,7 @@ void InitGame(GameState* g){ g->target = LoadRenderTexture(GetScreenWidth(), GetScreenHeight()); } -void UpdateGame(GameState* g){ +void UpdateGame(GameState* g, Screen *currentScreen){ UpdatePostFX(&g->postFX); UpdateMusic(&g->ambient); UpdateMouse(&g->mouse, &g->camera); @@ -74,6 +74,11 @@ void UpdateGame(GameState* g){ UpdateFloor(&g->floor, &g->camera); UpdatePlayer(&g->player); UpdateBee(&g->bee1, &g->flowers, &g->hive); + + if (IsKeyPressed(KEY_ESCAPE)){ + *currentScreen = MENU; + } + } void RenderComponents(GameState* g){ diff --git a/src/main.c b/src/main.c index 19d5078..33847d4 100644 --- a/src/main.c +++ b/src/main.c @@ -27,7 +27,7 @@ int main(void) InitMenu(&menu); InitGame(&game); - while (!WindowShouldClose()) + while (true) { switch (currentScreen) { @@ -43,7 +43,7 @@ int main(void) }break; case GAMEPLAY: { - UpdateGame(&game); + UpdateGame(&game, ¤tScreen); RenderGame(&game); }break; default: break;