RW2026 - Abans d'anar li vaig dir a Claude que arreglara coses de input i game pq pareixia que al disparar es perdien inputs

This commit is contained in:
2026-03-22 23:04:45 +01:00
parent c610065fe0
commit c35889a840
4 changed files with 28 additions and 4 deletions

View File

@@ -984,9 +984,9 @@ void Game::run() {
while (Section::name == Section::Name::GAME) {
const float DELTA_TIME = calculateDeltaTime();
handleEvents();
checkInput();
update(DELTA_TIME);
handleEvents(); // Tiene que ir antes del render
render();
}
}
@@ -1128,6 +1128,7 @@ auto Game::allPlayersAreNotPlaying() -> bool {
// Comprueba los eventos que hay en cola
void Game::handleEvents() {
input_->resetJustPressed();
SDL_Event event;
while (SDL_PollEvent(&event)) {
switch (event.type) {