[Updated] Code for use with WASM, [TODO] Make enemy gun follow player, spawn bullets from tip of the barrel

This commit is contained in:
Ninjaws
2024-12-17 23:15:26 +01:00
parent 2400b0500a
commit d740e1a167
25 changed files with 371 additions and 438 deletions
+4 -3
View File
@@ -6,6 +6,7 @@
#include "entities/TextureWrapper.h"
#include "entities/Vector2i.h"
#include <cmath>
#include <cstdint>
class Enemy
{
@@ -47,7 +48,7 @@ public:
return this->texture;
}
u_int8_t getHealth()
uint8_t getHealth()
{
return this->health;
}
@@ -61,8 +62,8 @@ private:
TextureWrapper texture;
TextureWrapper gunLeft;
TextureWrapper gunRight;
u_int8_t health;
u_int8_t maxHealth = 5;
uint8_t health;
uint8_t maxHealth = 5;
Vector2 velocity = {0, 0};
float spottingRange = 300; // From how far away enemies can spot the player
float gravity = 0.6f;