[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
+2 -2
View File
@@ -1,7 +1,7 @@
#include "screens/MainScreen.h"
#include "raylib.h"
#include "services/AudioService.h"
#include "services/StateService.h"
#include "raylib.h"
#include "services/InputService.h"
MainScreen::MainScreen()
@@ -60,7 +60,7 @@ void MainScreen::mouseLogic()
Vector2 pos = buttons[i].getPosition();
Rectangle rect = {pos.x, pos.y, dim.x, dim.y};
Vector2 mousePos = GetMousePosition();
Vector2 mousePos = InputService::getInstance().getMousePos();
// mousePos.x >= rect.x && mousePos.x <= (rect.x+rect.width) &&
if ((mousePos.x + textPadding) >= rect.x && mousePos.x <= (rect.x + rect.width + textPadding) && (mousePos.y + textPadding) >= rect.y && mousePos.y <= (rect.y + rect.height + textPadding))
{