From 1482d95397c71a056c1d8b0ea21f77bb0eedb0b7 Mon Sep 17 00:00:00 2001 From: Kapitan Date: Mon, 3 Jan 2022 12:44:24 +0100 Subject: [PATCH] [Zad3] Remove comments, add more text --- 2dgk_zad3/2dgk_zad3/2dgk_zad3.vcxproj | 6 --- 2dgk_zad3/2dgk_zad3/2dgk_zad3.vcxproj.filters | 2 - 2dgk_zad3/2dgk_zad3/KGame.cpp | 37 +++++++++-------- 2dgk_zad3/2dgk_zad3/assets/levels/level1.txt | 12 +++--- 2dgk_zad3/2dgk_zad3/assets/levels/level2.txt | 37 ----------------- 2dgk_zad3/2dgk_zad3/assets/levels/level3.txt | 41 ------------------- 6 files changed, 25 insertions(+), 110 deletions(-) delete mode 100644 2dgk_zad3/2dgk_zad3/assets/levels/level2.txt delete mode 100644 2dgk_zad3/2dgk_zad3/assets/levels/level3.txt diff --git a/2dgk_zad3/2dgk_zad3/2dgk_zad3.vcxproj b/2dgk_zad3/2dgk_zad3/2dgk_zad3.vcxproj index c4612ad..4bd2c1d 100644 --- a/2dgk_zad3/2dgk_zad3/2dgk_zad3.vcxproj +++ b/2dgk_zad3/2dgk_zad3/2dgk_zad3.vcxproj @@ -218,12 +218,6 @@ true - - true - - - true - diff --git a/2dgk_zad3/2dgk_zad3/2dgk_zad3.vcxproj.filters b/2dgk_zad3/2dgk_zad3/2dgk_zad3.vcxproj.filters index e8a8395..7896c6e 100644 --- a/2dgk_zad3/2dgk_zad3/2dgk_zad3.vcxproj.filters +++ b/2dgk_zad3/2dgk_zad3/2dgk_zad3.vcxproj.filters @@ -179,7 +179,5 @@ - - \ No newline at end of file diff --git a/2dgk_zad3/2dgk_zad3/KGame.cpp b/2dgk_zad3/2dgk_zad3/KGame.cpp index 418d9e5..bcf152b 100644 --- a/2dgk_zad3/2dgk_zad3/KGame.cpp +++ b/2dgk_zad3/2dgk_zad3/KGame.cpp @@ -254,7 +254,6 @@ namespace KapitanGame { if (Input.IsKeyboardButtonHeld(SDL_SCANCODE_F3)) { Settings.MaxJumpHeight -= 0.1f; - //Settings.SetMaxJumpHeight(Settings.GetMaxJumpHeight() - 0.1f); SettingsTextTextureDirty = true; } if (Input.IsKeyboardButtonHeld(SDL_SCANCODE_F4)) @@ -300,19 +299,25 @@ namespace KapitanGame { camera.Update(Pawns, Map); } - //if (SettingsTextTextureDirty) { - Textures.insert_or_assign("Text_Settings", Fonts["PressStart2P-Regular"].GetTextTexture( - Utils::StringFormat( - "Max Jump Height: %f\nHorizontal Distance to Max Jump Height: %f\nInitial Jump Velocity: %f\nGravity: %f\nPlayer Position X: %f\nPlayer Position Y: %f", - static_cast(Settings.MaxJumpHeight), - static_cast(Settings.HorizontalDistanceToMaxJumpHeight), - static_cast(Settings.JumpInitialVelocity), - static_cast(Settings.Gravity), - Pawns.back()->GetPosition().X, - Pawns.back()->GetPosition().Y), {0, 0, 0, 0xFF}, - Renderer)); - //SettingsTextTextureDirty = false; - //} + Textures.insert_or_assign("Text_Settings", Fonts["PressStart2P-Regular"].GetTextTexture( + Utils::StringFormat( + "Developer Mode (F1): %d\n" + "Collision Enabled (F2): %s\n" + "Max Jump Height (F3/F4): %f\n" + "Horizontal Distance to Max Jump Height (F5/F6): %f\n" + "Initial Jump Velocity: %f\n" + "Gravity: %f\n" + "Player Position X: %f\n" + "Player Position Y: %f", + static_cast(devMode), + Settings.CollisionEnabled ? "True" : "False", + static_cast(Settings.MaxJumpHeight), + static_cast(Settings.HorizontalDistanceToMaxJumpHeight), + static_cast(Settings.JumpInitialVelocity), + static_cast(Settings.Gravity), + Pawns.back()->GetPosition().X, + Pawns.back()->GetPosition().Y), { 0, 0, 0, 0xFF }, + Renderer)); if (!Playing) @@ -348,10 +353,6 @@ namespace KapitanGame { } if (devMode >= 2) { - SDL_SetRenderDrawColor(Renderer, 0x00, 0x00, 0x00, 0xFF); - SDL_RenderDrawLineF(Renderer, 0, Constants::SCREEN_HEIGHT / 2.f, Constants::SCREEN_WIDTH, Constants::SCREEN_HEIGHT / 2.f); - SDL_RenderDrawLineF(Renderer, Constants::SCREEN_WIDTH / 2.f, 0, Constants::SCREEN_WIDTH / 2.f, Constants::SCREEN_HEIGHT); - SDL_SetRenderDrawColor(Renderer, 0x00, 0xFF, 0x00, 0xFF); SDL_RenderDrawPointF(Renderer, camera.GetFocusPoint().X * debugCamera.GetScale(), camera.GetFocusPoint().Y * debugCamera.GetScale()); SDL_SetRenderDrawColor(Renderer, 0xFF, 0x00, 0x00, 0xFF); diff --git a/2dgk_zad3/2dgk_zad3/assets/levels/level1.txt b/2dgk_zad3/2dgk_zad3/assets/levels/level1.txt index 6ecec00..bd1c653 100644 --- a/2dgk_zad3/2dgk_zad3/assets/levels/level1.txt +++ b/2dgk_zad3/2dgk_zad3/assets/levels/level1.txt @@ -7,9 +7,9 @@ - # ##### ## - ## ## - ## ## ## - P ## ## ## -################################################################## -################################################################## \ No newline at end of file + # ##### ## ## + ## ## ## + ## ## ## ## + P ## ## ## ## +############################################################################ +############################################################################ \ No newline at end of file diff --git a/2dgk_zad3/2dgk_zad3/assets/levels/level2.txt b/2dgk_zad3/2dgk_zad3/assets/levels/level2.txt deleted file mode 100644 index 9d7cf99..0000000 --- a/2dgk_zad3/2dgk_zad3/assets/levels/level2.txt +++ /dev/null @@ -1,37 +0,0 @@ -##################################### -# # # # # # # -# ### ### # # # ######### # ##### # # -# # # # # # # # # # -### # ### # ####### # # ##### # ### # -# # # # # # # # # -### ########### # ### # # # # ### ### -# # # # # # # # # # # # -# # ### ### # ### ### # ######### # # -# # # # # # # # # -# # ### # # ### # # # ### ######### # -# # # # # # # # # # # # # # -# ##### # # # # ####### ### ##### # # -# # # # # # # # -# ##### # # # ##### ####### ### # ### -# # # # # # # # # # -####### ### ### # # # # ### ####### # -# # # # # # # # # # # # -# ##### # # ##### ### # ### # # ### # -# # # # # # # # # # # # # # -# # # ### ### ### ### # ### ##### ### -# # # # # # # # # -# ####### ##### # ### ####### ####### -# # # # # # # -# # ### ##### ############# ### ##### -# # # # # # # # # # -### # # ######### # # # # # # # ### # -# # # # # # # # # # -# ##### ### ### # # ### # ### ##### # -# # # # # # # # # # # # -# # ### ### # # # # ##### # # # # # # -# # # # # # # # # # # # # # -# ####### ### ######### ######### # # -# # # # # # # # # # # -# # ######### # # # ##### # # # # # # -# # # # # -##################################### \ No newline at end of file diff --git a/2dgk_zad3/2dgk_zad3/assets/levels/level3.txt b/2dgk_zad3/2dgk_zad3/assets/levels/level3.txt deleted file mode 100644 index 96e2dfb..0000000 --- a/2dgk_zad3/2dgk_zad3/assets/levels/level3.txt +++ /dev/null @@ -1,41 +0,0 @@ -######################################### -# # # # # # # # -# # ### # # ####### ### ####### ####### # -# # # # # # # # # # # -# # # # # ##### ####### # ### # ### ##### -# # # # # # # # # # -# # ### # ##### ##### ### ### # ##### # # -# # # # # # # # # # -### ######### ##### ####### ### ##### # # -# # # # # # # # # # # -# ### # ### ### ##### # # ### ### # ### # -# # # # # # # # # # # # -### ### ####### # # # ####### # # # # # # -# # # # # # # # # # # # # # # -# ### # # ### ### # ### # # ### ##### ### -# # # # # # # # # # # # -# # # ### ##### ##### # ##### # # ### ### -# # # # # # # # -# ####### ### ### # # ######### # ####### -# # # # # # # # -# ### ##### ### # ########### ######### # -# # # # # # # # # # # # -# ##### # # ### ### ### ### # # # # ### # -# # # # # # # # # # # # # -# # ### # ### # ### # ##### ##### # # ### -# # # # # # # # # # # # -# ##### ####### ####### ### ##### # # # # -# # # # # # # # # # # # # -### ### ### ### # # ### ##### ####### # # -# # # # # # # # # -### ##### ##### ### ##### # ### ### # # # -# # # # # # # # # # # -# ##### # ### ##### # # # ### ### ### # # -# # # # # # # # # # # # -##### # ### ##### ### # # # ### # # # ### -# # # # # # # # # # # -# ##### ####### ####### # ##### ### # ### -# # # # # # # # # # # -# # # # ### ### # ### # ##### ### # # # # -# # # # # # # # # # # # -######################################### \ No newline at end of file