From abf896ce6db8746554a45bb93fccf35a2d9cee38 Mon Sep 17 00:00:00 2001 From: Wojtek Date: Thu, 8 Feb 2024 04:55:27 +0100 Subject: [PATCH] nitroes 2 --- grk/project/Nitro.h | 5 ++++- grk/project/Spaceship.h | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/grk/project/Nitro.h b/grk/project/Nitro.h index b684197..720a809 100644 --- a/grk/project/Nitro.h +++ b/grk/project/Nitro.h @@ -11,6 +11,7 @@ public: glm::mat4 modelMatrix; glm::mat4 initialModelMatrix; float healAmount = 10; + bool isCollected; Nitro(glm::mat4 initialModelMatrix, float healAmount) @@ -18,14 +19,16 @@ public: modelMatrix(initialModelMatrix), initialModelMatrix(initialModelMatrix), healAmount(healAmount), + isCollected(false), GameEntity(1, 1, 0) {} virtual ~Nitro() = default; - virtual bool isAlive() const { + virtual bool isAlive() { if (this->currentHP <= 0) { + isCollected = true; return false; } return true; diff --git a/grk/project/Spaceship.h b/grk/project/Spaceship.h index 7332954..81204ae 100644 --- a/grk/project/Spaceship.h +++ b/grk/project/Spaceship.h @@ -399,4 +399,7 @@ public: this->currentHP = this->currentHP + 3.f; } + void turboBoost() { + this->turbo = this->turboMAX; + } }; \ No newline at end of file