[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
+3 -2
View File
@@ -4,6 +4,7 @@
#include "raylib.h"
#include "services/AssetService.h"
#include "entities/TextureWrapper.h"
#include <cstdint>
class Powerup {
public:
@@ -40,8 +41,8 @@ class Powerup {
bool pickedUp = false; // When the player has picked up the pack
float animationDelay = 0.08f; // How long to wait in between animation frames (in seconds)
double lastFrame; // Time since the last frame
u_int8_t currentFrame = 0; // Current frame of the animation
u_int8_t amountOfFrames = 8; // Total amount of animation frames
uint8_t currentFrame = 0; // Current frame of the animation
uint8_t amountOfFrames = 8; // Total amount of animation frames
void animate() {
if(GetTime() - lastFrame > animationDelay) {