From 1643c2fdaf0699fd9b66eb40635e02ce1e605f5c Mon Sep 17 00:00:00 2001 From: john Date: Sun, 18 Oct 2026 12:17:24 -0400 Subject: [PATCH] playable moar --- Engine.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Engine.cpp b/Engine.cpp index 0ce858c..7eef487 100644 --- a/Engine.cpp +++ b/Engine.cpp @@ -288,7 +288,7 @@ void Engine::Initiate() netText->text = ""; netText->fontsize = 0.5f; netText->Color = { 1.0f, 1.0f, 1.0f }; - netText->t2d.position = { 1.0f, 0.0f, 0.0f, 40.0f }; + netText->t2d.position = { 1.0f, 0.0f, 0.0f, 110.0f }; netText->t2d.center = { 1.0f, 0.0f }; netText->textCenter = { 1.0f, 0.5f }; netText->t2d.size = { 0.0f, 0.0f, 360.0f, 40.0f }; @@ -309,12 +309,12 @@ void Engine::Initiate() TextBox* hpText = new TextBox(); hpText->font = arial; hpText->text = "100/100 HP"; - hpText->fontsize = 0.7f; + hpText->fontsize = 0.6f; hpText->Color = { 1.0f, 1.0f, 1.0f }; hpText->t2d.position = { 0.0f, 1.0f, 20.0f, -20.0f }; hpText->t2d.center = { 0.0f, 1.0f }; hpText->textCenter = { 0.0f, 0.5f }; - hpText->t2d.size = { 0.0f, 0.0f, 220.0f, 50.0f }; + hpText->t2d.size = { 0.0f, 0.0f, 400.0f, 90.0f }; hpText->BindToRenderSystem(); TextBox* grappleText = new TextBox(); @@ -457,6 +457,8 @@ void Engine::Initiate() float slideCooldown = 0.0f; const float dashCooldownTime = 1.5f; // seconds between dashes float dashCooldown = 0.0f; + const float shootCooldownTime = 0.5f; // seconds between shots + float shootCooldown = 0.0f; glm::vec3 slideDir(0.0f); // Shockwave (key Q): projectile that explodes on the first surface it touches. The blast @@ -646,7 +648,10 @@ void Engine::Initiate() camera->ProcessMouseMovement(xoffset, yoffset); } else if (buffer.GetType() == Mouse::Event::Type::LPress) { - Shoot(); + if (shootCooldown <= 0.0f) { + shootCooldown = shootCooldownTime; + Shoot(); + } } else if (buffer.GetType() == Mouse::Event::Type::RPress) { camera->lockedcursor = !camera->lockedcursor; @@ -802,6 +807,7 @@ void Engine::Initiate() grappleCooldown = std::max(grappleCooldown - deltatime, 0.0f); slideCooldown = std::max(slideCooldown - deltatime, 0.0f); dashCooldown = std::max(dashCooldown - deltatime, 0.0f); + shootCooldown = std::max(shootCooldown - deltatime, 0.0f); const float accel = 40.0f; const float damp = 0.75f; const float groundTopSpeed = movespeed * accel * refDt * damp / (1.0f - damp);