[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
+8 -10
View File
@@ -1,16 +1,17 @@
#ifndef STATE_SERVICE_H
#define STATE_SERVICE_H
#include <iostream>
#include <memory>
#include "services/Service.h"
#include "screens/Screen.h"
#include "enums/EScreen.h"
#include "raylib.h"
#include "enums/EScreen.h"
#include "services/Service.h"
#include "services/InputService.h"
#include "screens/Screen.h"
#include <memory>
#if defined(PLATFORM_WEB)
#include <emscripten/emscripten.h>
#endif
// #include <emscripten/html5.h>
/**
* Handles switching between screens
@@ -34,14 +35,10 @@ public:
void startGame();
static void staticStep()
{
if (IsKeyPressed(KEY_ENTER) || IsMouseButtonPressed(MOUSE_BUTTON_LEFT))
{
std::cout << "Input!" << std::endl;
}
// Access the singleton instance and call step
getInstance().step();
}
private:
std::unique_ptr<Screen> currentScreen;
bool gameRunning = true;
@@ -52,6 +49,7 @@ private:
*/
void step();
void handleMusic();
};
#endif