From 95af27eafb3bab3a5f93c7c04b2576e02d6789fa Mon Sep 17 00:00:00 2001 From: "Y0L042@DinkBoekWin11" Date: Fri, 7 Jun 2024 16:39:47 +0200 Subject: [PATCH] added basic player movement for Astroids demo --- Duin/Duin.vcxproj | 13 ++++- Duin/src/Duin/Core/Maths/src/Vector2.h | 14 +++++ ExampleProjects/Astroids/Astroids.vcxproj | 14 +++++ .../Astroids/Astroids.vcxproj.filters | 40 ++++++++++++++ ExampleProjects/Astroids/assets/spaceship.png | Bin 0 -> 20512 bytes ExampleProjects/Astroids/imgui.ini | 4 ++ ExampleProjects/Astroids/src/Astroids.cpp | 50 ++++++++++++++++++ .../src/Components/Component_AstroidInput.h | 8 +++ .../src/Components/Component_Movement.h | 19 +++++++ .../src/Components/Component_PlayerInput.h | 8 +++ .../src/Components/Component_Renderable.h | 17 ++++++ .../src/Components/Component_Transform.h | 9 ++++ .../src/Components/Handler_PlayerInput.h | 25 +++++++++ .../src/Components/Handler_PlayerMovement.h | 27 ++++++++++ .../src/Components/Handler_Renderable.h | 25 +++++++++ .../src/Components/Handler_UpdateTransform.h | 41 ++++++++++++++ premake5.lua | 12 +++-- 17 files changed, 320 insertions(+), 6 deletions(-) create mode 100644 ExampleProjects/Astroids/Astroids.vcxproj.filters create mode 100644 ExampleProjects/Astroids/assets/spaceship.png create mode 100644 ExampleProjects/Astroids/imgui.ini create mode 100644 ExampleProjects/Astroids/src/Components/Component_AstroidInput.h create mode 100644 ExampleProjects/Astroids/src/Components/Component_Movement.h create mode 100644 ExampleProjects/Astroids/src/Components/Component_PlayerInput.h create mode 100644 ExampleProjects/Astroids/src/Components/Component_Renderable.h create mode 100644 ExampleProjects/Astroids/src/Components/Component_Transform.h create mode 100644 ExampleProjects/Astroids/src/Components/Handler_PlayerInput.h create mode 100644 ExampleProjects/Astroids/src/Components/Handler_PlayerMovement.h create mode 100644 ExampleProjects/Astroids/src/Components/Handler_Renderable.h create mode 100644 ExampleProjects/Astroids/src/Components/Handler_UpdateTransform.h diff --git a/Duin/Duin.vcxproj b/Duin/Duin.vcxproj index 632f7a7..f98172d 100644 --- a/Duin/Duin.vcxproj +++ b/Duin/Duin.vcxproj @@ -93,6 +93,11 @@ vendor\raylib5\lib;vendor\rlimgui\bin\Debug;%(AdditionalLibraryDirectories) ..\bin\Debug-windows-x86_64\Duin\Duin.lib + + IF EXIST ..\bin\Debug-windows-x86_64\Duin\Duin.dll\ (xcopy /Q /E /Y /I ..\bin\Debug-windows-x86_64\Duin\Duin.dll ..\bin\Debug-windows-x86_64\Sandbox > nul) ELSE (xcopy /Q /Y /I ..\bin\Debug-windows-x86_64\Duin\Duin.dll ..\bin\Debug-windows-x86_64\Sandbox > nul) +IF EXIST ..\bin\Debug-windows-x86_64\Duin\Duin.dll\ (xcopy /Q /E /Y /I ..\bin\Debug-windows-x86_64\Duin\Duin.dll ..\bin\Debug-windows-x86_64\DuinEditor > nul) ELSE (xcopy /Q /Y /I ..\bin\Debug-windows-x86_64\Duin\Duin.dll ..\bin\Debug-windows-x86_64\DuinEditor > nul) +IF EXIST ..\bin\Debug-windows-x86_64\Duin\Duin.dll\ (xcopy /Q /E /Y /I ..\bin\Debug-windows-x86_64\Duin\Duin.dll ..\bin\Debug-windows-x86_64\Astroids > nul) ELSE (xcopy /Q /Y /I ..\bin\Debug-windows-x86_64\Duin\Duin.dll ..\bin\Debug-windows-x86_64\Astroids > nul) + @@ -118,6 +123,11 @@ vendor\raylib5\lib;vendor\rlimgui\bin\Debug;%(AdditionalLibraryDirectories) ..\bin\Release-windows-x86_64\Duin\Duin.lib + + IF EXIST ..\bin\Release-windows-x86_64\Duin\Duin.dll\ (xcopy /Q /E /Y /I ..\bin\Release-windows-x86_64\Duin\Duin.dll ..\bin\Release-windows-x86_64\Sandbox > nul) ELSE (xcopy /Q /Y /I ..\bin\Release-windows-x86_64\Duin\Duin.dll ..\bin\Release-windows-x86_64\Sandbox > nul) +IF EXIST ..\bin\Release-windows-x86_64\Duin\Duin.dll\ (xcopy /Q /E /Y /I ..\bin\Release-windows-x86_64\Duin\Duin.dll ..\bin\Release-windows-x86_64\DuinEditor > nul) ELSE (xcopy /Q /Y /I ..\bin\Release-windows-x86_64\Duin\Duin.dll ..\bin\Release-windows-x86_64\DuinEditor > nul) +IF EXIST ..\bin\Release-windows-x86_64\Duin\Duin.dll\ (xcopy /Q /E /Y /I ..\bin\Release-windows-x86_64\Duin\Duin.dll ..\bin\Release-windows-x86_64\Astroids > nul) ELSE (xcopy /Q /Y /I ..\bin\Release-windows-x86_64\Duin\Duin.dll ..\bin\Release-windows-x86_64\Astroids > nul) + @@ -145,7 +155,8 @@ IF EXIST ..\bin\Dist-windows-x86_64\Duin\Duin.dll\ (xcopy /Q /E /Y /I ..\bin\Dist-windows-x86_64\Duin\Duin.dll ..\bin\Dist-windows-x86_64\Sandbox > nul) ELSE (xcopy /Q /Y /I ..\bin\Dist-windows-x86_64\Duin\Duin.dll ..\bin\Dist-windows-x86_64\Sandbox > nul) -IF EXIST ..\bin\Dist-windows-x86_64\Duin\Duin.dll\ (xcopy /Q /E /Y /I ..\bin\Dist-windows-x86_64\Duin\Duin.dll ..\bin\Dist-windows-x86_64\DuinEditor > nul) ELSE (xcopy /Q /Y /I ..\bin\Dist-windows-x86_64\Duin\Duin.dll ..\bin\Dist-windows-x86_64\DuinEditor > nul) +IF EXIST ..\bin\Dist-windows-x86_64\Duin\Duin.dll\ (xcopy /Q /E /Y /I ..\bin\Dist-windows-x86_64\Duin\Duin.dll ..\bin\Dist-windows-x86_64\DuinEditor > nul) ELSE (xcopy /Q /Y /I ..\bin\Dist-windows-x86_64\Duin\Duin.dll ..\bin\Dist-windows-x86_64\DuinEditor > nul) +IF EXIST ..\bin\Dist-windows-x86_64\Duin\Duin.dll\ (xcopy /Q /E /Y /I ..\bin\Dist-windows-x86_64\Duin\Duin.dll ..\bin\Dist-windows-x86_64\Astroids > nul) ELSE (xcopy /Q /Y /I ..\bin\Dist-windows-x86_64\Duin\Duin.dll ..\bin\Dist-windows-x86_64\Astroids > nul) diff --git a/Duin/src/Duin/Core/Maths/src/Vector2.h b/Duin/src/Duin/Core/Maths/src/Vector2.h index a4d86b2..2ce5f5f 100644 --- a/Duin/src/Duin/Core/Maths/src/Vector2.h +++ b/Duin/src/Duin/Core/Maths/src/Vector2.h @@ -107,5 +107,19 @@ namespace Duin } return Vector2(x / mag, y / mag); } + + Vector2 LimitLength(float minLength, float maxLength) const + { + float mag = Magnitude(); + if (mag < minLength) + { + return Normalized() * minLength; + } + else if (mag > maxLength) + { + return Normalized() * maxLength; + } + return *this; + } }; } \ No newline at end of file diff --git a/ExampleProjects/Astroids/Astroids.vcxproj b/ExampleProjects/Astroids/Astroids.vcxproj index 2f06f47..240bc3d 100644 --- a/ExampleProjects/Astroids/Astroids.vcxproj +++ b/ExampleProjects/Astroids/Astroids.vcxproj @@ -138,6 +138,20 @@ ..\..\Duin\vendor\raylib5\lib;..\..\Duin\vendor\rlimgui\bin\Debug;%(AdditionalLibraryDirectories) + + + + + + + + + + + + + + {F558847C-E18F-850D-8A7C-6B107692010F} diff --git a/ExampleProjects/Astroids/Astroids.vcxproj.filters b/ExampleProjects/Astroids/Astroids.vcxproj.filters new file mode 100644 index 0000000..7aa5714 --- /dev/null +++ b/ExampleProjects/Astroids/Astroids.vcxproj.filters @@ -0,0 +1,40 @@ + + + + + {6B7DD516-5735-1764-C03C-F0BFAC13B254} + + + + + Components + + + Components + + + Components + + + Components + + + Components + + + Components + + + Components + + + Components + + + Components + + + + + + \ No newline at end of file diff --git a/ExampleProjects/Astroids/assets/spaceship.png b/ExampleProjects/Astroids/assets/spaceship.png new file mode 100644 index 0000000000000000000000000000000000000000..333fcbdba3348e116bd7cb4766a66d667bb5fb45 GIT binary patch literal 20512 zcmb@ug;x~+_dh;M!;2C@x>JynZj_c*>6UKkW*1RFT96Q=6+yZscNIku5Rh0Jlonx; zhGloY!~1i7|H035JaD}8e9oOa_xZSw8{=~mBONLV7773WsPuF-?*jk<^eX{CMgsjf z3ZJ}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{|aQ zCMKONqIPZPPJ# #include +#include + +#include "Components/Component_Movement.h" +#include "Components/Component_PlayerInput.h" +#include "Components/Component_Transform.h" +#include "Components/Component_Renderable.h" +#include "Components/Handler_PlayerInput.h" +#include "Components/Handler_PlayerMovement.h" +#include "Components/Handler_UpdateTransform.h" +#include "Components/Handler_Renderable.h" + class Astroids : public Duin::Application { public: @@ -8,17 +19,41 @@ class Astroids : public Duin::Application ~Astroids() {} void Initialize() override; + void Exit() override; void Ready() override; void HandleInputs(Duin::InputEvent e) override; void Process(double rDelta) override; void PhysicsProcess(double pDelta) override; void Draw() override; + Duin::Registry* registry; + Handler_PlayerInput* handlerPlayerInput; + Handler_PlayerMovement* handlerPlayerMovement; + Handler_UpdateTransform* handlerUpdateTransform; + Handler_Renderable* handlerRenderable; + std::shared_ptr player; + void CreatePlayer(); }; +Duin::Application* Duin::CreateApplication() { return new Astroids(); } void Astroids::Initialize() { + registry = new Duin::Registry(); + handlerPlayerInput = new Handler_PlayerInput(registry); + handlerPlayerMovement = new Handler_PlayerMovement(registry); + handlerUpdateTransform = new Handler_UpdateTransform(registry, 1280 - 25, 720 - 25); + handlerRenderable = new Handler_Renderable(registry); + CreatePlayer(); +} + +void Astroids::Exit() +{ + delete registry; + delete handlerPlayerInput; + delete handlerPlayerMovement; + delete handlerUpdateTransform; + delete handlerRenderable; } void Astroids::Ready() @@ -27,6 +62,7 @@ void Astroids::Ready() void Astroids::HandleInputs(Duin::InputEvent e) { + handlerPlayerInput->Update(e); } void Astroids::Process(double rDelta) @@ -35,8 +71,22 @@ void Astroids::Process(double rDelta) void Astroids::PhysicsProcess(double pDelta) { + handlerPlayerMovement->Update(); + + handlerUpdateTransform->Update(pDelta); } void Astroids::Draw() { + handlerRenderable->Update(); +} + +void Astroids::CreatePlayer() +{ + std::shared_ptr texture = std::make_shared("assets/spaceship.png"); + player = Duin::Entity::Create(registry); + player->AddComponent(); + player->AddComponent(); + player->AddComponent(); + player->AddComponent(texture, Duin::Vector2{ 25, 25 }); } diff --git a/ExampleProjects/Astroids/src/Components/Component_AstroidInput.h b/ExampleProjects/Astroids/src/Components/Component_AstroidInput.h new file mode 100644 index 0000000..0552fcd --- /dev/null +++ b/ExampleProjects/Astroids/src/Components/Component_AstroidInput.h @@ -0,0 +1,8 @@ +#pragma once + +#include + +struct Component_AstroidInput +{ + bool enableStatusComponent = true; +}; \ No newline at end of file diff --git a/ExampleProjects/Astroids/src/Components/Component_Movement.h b/ExampleProjects/Astroids/src/Components/Component_Movement.h new file mode 100644 index 0000000..7960fa9 --- /dev/null +++ b/ExampleProjects/Astroids/src/Components/Component_Movement.h @@ -0,0 +1,19 @@ +#pragma once + +#include + +struct Component_Movement +{ + float maxSpeed = 1.0f; + float acceleration = 1.0f; + + float currSpeed = 0.0f; + Duin::Vector2 inputDir; + Duin::Vector2 prevVelocity; + Duin::Vector2 currVelocity; + + Component_Movement() = default; + Component_Movement(float maxSpeed, float acceleration) + : maxSpeed(maxSpeed), acceleration(acceleration) + {} +}; \ No newline at end of file diff --git a/ExampleProjects/Astroids/src/Components/Component_PlayerInput.h b/ExampleProjects/Astroids/src/Components/Component_PlayerInput.h new file mode 100644 index 0000000..a1e8221 --- /dev/null +++ b/ExampleProjects/Astroids/src/Components/Component_PlayerInput.h @@ -0,0 +1,8 @@ +#pragma once + +#include + +struct Component_PlayerInput +{ + bool enableStatusComponent = true; +}; \ No newline at end of file diff --git a/ExampleProjects/Astroids/src/Components/Component_Renderable.h b/ExampleProjects/Astroids/src/Components/Component_Renderable.h new file mode 100644 index 0000000..8b44cdc --- /dev/null +++ b/ExampleProjects/Astroids/src/Components/Component_Renderable.h @@ -0,0 +1,17 @@ +#pragma once + +#include + +#include + +struct Component_Renderable +{ + std::shared_ptr texture; + Duin::Vector2 size; + + Component_Renderable(std::shared_ptr texture, Duin::Vector2 size) + : texture(texture), size(size) + { + texture->SetTextureSize(size); + } +}; \ No newline at end of file diff --git a/ExampleProjects/Astroids/src/Components/Component_Transform.h b/ExampleProjects/Astroids/src/Components/Component_Transform.h new file mode 100644 index 0000000..1da4d50 --- /dev/null +++ b/ExampleProjects/Astroids/src/Components/Component_Transform.h @@ -0,0 +1,9 @@ +#pragma once + +#include + +struct Component_Transform +{ + Duin::Vector2 prevPosition; + Duin::Vector2 position; +}; \ No newline at end of file diff --git a/ExampleProjects/Astroids/src/Components/Handler_PlayerInput.h b/ExampleProjects/Astroids/src/Components/Handler_PlayerInput.h new file mode 100644 index 0000000..8917399 --- /dev/null +++ b/ExampleProjects/Astroids/src/Components/Handler_PlayerInput.h @@ -0,0 +1,25 @@ +#pragma once + +#include + +#include "Component_PlayerInput.h" +#include "Component_Movement.h" + +struct Handler_PlayerInput +{ + Duin::Registry* registry; + + Handler_PlayerInput() = default; + Handler_PlayerInput(Duin::Registry* registry) + : registry(registry) + {} + + void Update(Duin::InputEvent e) + { + auto view = registry->View(); + for (auto [entity, c_pinput, c_movement] : view.each()) + { + c_movement.inputDir = e.GetInputVector(Duin::KEY_W, Duin::KEY_S, Duin::KEY_A, Duin::KEY_D); + } + } +}; \ No newline at end of file diff --git a/ExampleProjects/Astroids/src/Components/Handler_PlayerMovement.h b/ExampleProjects/Astroids/src/Components/Handler_PlayerMovement.h new file mode 100644 index 0000000..9bb4497 --- /dev/null +++ b/ExampleProjects/Astroids/src/Components/Handler_PlayerMovement.h @@ -0,0 +1,27 @@ +#pragma once + +#include + +#include "Component_PlayerInput.h" +#include "Component_Movement.h" + +struct Handler_PlayerMovement +{ + Duin::Registry* registry; + + Handler_PlayerMovement() = default; + Handler_PlayerMovement(Duin::Registry* registry) + : registry(registry) + {} + + void Update() + { + auto view = registry->View(); + for (auto [entity, c_pinput, c_movement] : view.each()) + { + c_movement.prevVelocity = c_movement.currVelocity; + c_movement.currVelocity += c_movement.inputDir * c_movement.acceleration; + c_movement.currVelocity.LimitLength(0.0f, c_movement.maxSpeed); + } + } +}; \ No newline at end of file diff --git a/ExampleProjects/Astroids/src/Components/Handler_Renderable.h b/ExampleProjects/Astroids/src/Components/Handler_Renderable.h new file mode 100644 index 0000000..f77ef23 --- /dev/null +++ b/ExampleProjects/Astroids/src/Components/Handler_Renderable.h @@ -0,0 +1,25 @@ +#pragma once + +#include + +#include "Component_Renderable.h" +#include "Component_Transform.h" + +struct Handler_Renderable +{ + Duin::Registry* registry; + + Handler_Renderable() = default; + Handler_Renderable(Duin::Registry* registry) + : registry(registry) + {} + + void Update() + { + auto view = registry->View(); + for (auto [entity, c_renderable, c_transform] : view.each()) + { + c_renderable.texture->Draw(c_transform.position); + } + } +}; \ No newline at end of file diff --git a/ExampleProjects/Astroids/src/Components/Handler_UpdateTransform.h b/ExampleProjects/Astroids/src/Components/Handler_UpdateTransform.h new file mode 100644 index 0000000..0c384f0 --- /dev/null +++ b/ExampleProjects/Astroids/src/Components/Handler_UpdateTransform.h @@ -0,0 +1,41 @@ +#pragma once + +#include + +#include "Component_Transform.h" +#include "Component_Movement.h" + +struct Handler_UpdateTransform +{ + Duin::Registry* registry; + + int width, height = 0; + + Handler_UpdateTransform() = default; + Handler_UpdateTransform(Duin::Registry* registry, int borderWidth, int borderHeight) + : registry(registry), width(borderWidth), height(borderHeight) + {} + + void Update(double delta) + { + Duin::Vector2 testPos; + + auto view = registry->View(); + for (auto [entity, c_transform, c_movement] : view.each()) + { + c_transform.prevPosition = c_transform.position; + + testPos = c_transform.position; + testPos += c_movement.currVelocity * delta; + + if ((testPos.x < 0 || testPos.x > width) || (testPos.y < 0 || testPos.y > height)) + { + c_movement.currVelocity = Duin::Vector2::ZERO; + } + else + { + c_transform.position = testPos; + } + } + } +}; \ No newline at end of file diff --git a/premake5.lua b/premake5.lua index 4430a93..65eb6da 100644 --- a/premake5.lua +++ b/premake5.lua @@ -86,6 +86,13 @@ project "Duin" "IMGUI_IMPL_OPENGL_LOADER_GLAD", --necessary? } + postbuildcommands + { + ("{COPY} %{cfg.buildtarget.relpath} ../bin/" .. outputdir .. "/Sandbox"), + ("{COPY} %{cfg.buildtarget.relpath} ../bin/" .. outputdir .. "/DuinEditor"), + ("{COPY} %{cfg.buildtarget.relpath} ../bin/" .. outputdir .. "/Astroids"), + } + filter "configurations:Debug" defines "DN_DEBUG" symbols "On" @@ -100,11 +107,6 @@ project "Duin" -- MODIFY THESE WHEN ADDING LIBS AND NEW PROJECTS - postbuildcommands - { - ("{COPY} %{cfg.buildtarget.relpath} ../bin/" .. outputdir .. "/Sandbox"), - ("{COPY} %{cfg.buildtarget.relpath} ../bin/" .. outputdir .. "/DuinEditor"), - } global_includedirs =