diff options
author | nathansmithsmith <thenathansmithsmith@gmail.com> | 2023-12-22 02:02:13 -0700 |
---|---|---|
committer | nathansmithsmith <thenathansmithsmith@gmail.com> | 2023-12-22 02:02:13 -0700 |
commit | 35ccb272571efd684f050e579092ccb290a39c89 (patch) | |
tree | d325a46f1152c3312a5b331953d2d77ce29c75ef | |
parent | cb14754891d7850564f215bd932c47d74dc233fe (diff) |
Added some stuff to help the player
-rw-r--r-- | src/gameScreen.c | 6 | ||||
-rw-r--r-- | src/howToPlayScreen.c | 36 | ||||
-rw-r--r-- | src/howToPlayScreen.h | 1 |
3 files changed, 40 insertions, 3 deletions
diff --git a/src/gameScreen.c b/src/gameScreen.c index ab228b2..de650c5 100644 --- a/src/gameScreen.c +++ b/src/gameScreen.c @@ -209,9 +209,9 @@ void handleGameScreenInput(Game * game, GameScreen * gameScreen) { case KEY_THREE: gameScreen->mainCamera = ZOOM_CAMERA; break; - case KEY_FOUR: - gameScreen->mainCamera = DEBUG_CAMERA; - break; + // case KEY_FOUR: + // gameScreen->mainCamera = DEBUG_CAMERA; + // break; default: break; } diff --git a/src/howToPlayScreen.c b/src/howToPlayScreen.c index 1b342d4..8c31c20 100644 --- a/src/howToPlayScreen.c +++ b/src/howToPlayScreen.c @@ -5,6 +5,9 @@ void initHowToPlayScreen(Game * game) { HowToPlayScreen * howToPlayScreen = &game->howToPlayScreen; howToPlayScreen->goBackButton = (Rectangle){0.0, 25.0, 100.0, 50.0}; + howToPlayScreen->infoText = (Rectangle){0.0, 0.0, 0.0, 0.0}; + + resizeHowToPlayScreen(game, howToPlayScreen); } void updateHowToPlayScreen(Game * game) { @@ -12,11 +15,44 @@ void updateHowToPlayScreen(Game * game) { ClearBackground(RAYWHITE); + // Back to main menu button. bool backPressed = GuiButton(howToPlayScreen->goBackButton, "back"); if (backPressed) game->screenId = SCREEN_MAIN_MENU; + + // Info text. + const char info[] = + "Game play:\n" + " Kill fascist space ships and move on (:\n" + "Controls:\n" + " Sorry no wasd ):\n" + " Mouse to look around normally\n" + " Middle click with mouse movement to rotate\n" + " Scroll wheel to change the ship speed\n" + " Shift to slow down the mouse and scroll wheel\n" + " Ctrl to speed up the moues and scroll wheel\n" + " Number key to change the camera view\n" + " Left click to shoot\n" + " Right click to auto target\n" + "Using auto target:\n" + " Hitting things is hard so use the auto target pleaz (:\n" + " It will auto target on anything that is in range\n" + " Auto target will stop if you are out of range\n" + " The color will change from blue to red when you can kill\n" + " For some types of color blindness use the \"On Target\" instead\n" + " Try to manually aim to help the auto target"; + + DrawText(info, howToPlayScreen->infoText.x + 3, howToPlayScreen->infoText.y + 3, 20, BLACK); + DrawRectangleLinesEx(howToPlayScreen->infoText, 2, BLUE); } void resizeHowToPlayScreen(Game * game, HowToPlayScreen * howToPlayScreen) { + int width = GetScreenWidth(); + int height = GetScreenHeight(); + + howToPlayScreen->infoText.width = width / 1.5; + howToPlayScreen->infoText.height = height / 1.5; + howToPlayScreen->infoText.x = (width / 2.0) - (howToPlayScreen->infoText.width / 2.0); + howToPlayScreen->infoText.y = (height / 2.0) - (howToPlayScreen->infoText.height / 2.0); } diff --git a/src/howToPlayScreen.h b/src/howToPlayScreen.h index 8e8ee22..ff083e3 100644 --- a/src/howToPlayScreen.h +++ b/src/howToPlayScreen.h @@ -5,6 +5,7 @@ typedef struct HowToPlayScreen { Rectangle goBackButton; + Rectangle infoText; } HowToPlayScreen; void initHowToPlayScreen(Game * game); |