[Updated] Code for use with WASM, [TODO] Make enemy gun follow player, spawn bullets from tip of the barrel
This commit is contained in:
@@ -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))
|
||||
{
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
#include "services/StateService.h"
|
||||
#include "enums/EFont.h"
|
||||
#include "services/AudioService.h"
|
||||
#include <iostream>
|
||||
#include "services/InputService.h"
|
||||
|
||||
TitleScreen::TitleScreen()
|
||||
@@ -34,7 +33,6 @@ TitleScreen::TitleScreen()
|
||||
|
||||
void TitleScreen::logic()
|
||||
{
|
||||
// std::cout << "Next screen!" << std::endl;
|
||||
if (InputService::getInstance().isKeyPressed(KEY_ENTER) || InputService::getInstance().isMouseButtonPressed(MOUSE_BUTTON_LEFT))
|
||||
{
|
||||
StateService::getInstance().setScreen(EScreen::MAIN);
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#include "screens/TutorialScreen.h"
|
||||
|
||||
#include "services/StateService.h"
|
||||
#include "enums/EFont.h"
|
||||
#include "enums/EScreen.h"
|
||||
#include "enums/EFont.h"
|
||||
#include "services/StateService.h"
|
||||
#include "services/InputService.h"
|
||||
|
||||
TutorialScreen::TutorialScreen() {
|
||||
|
||||
Reference in New Issue
Block a user