From 475d5e7f9d4f11a02ba3609742a2c29e8ac11ad5 Mon Sep 17 00:00:00 2001 From: stian853 Date: Mon, 13 Nov 2023 08:30:23 +0100 Subject: [PATCH] la till lite kommentarer --- src/States.h | 2 +- src/_main.cc | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/States.h b/src/States.h index fc36a5b..c2a0179 100644 --- a/src/States.h +++ b/src/States.h @@ -8,7 +8,7 @@ #include "Map.h" #include "Player.h" -struct Context; +struct Context; //finns en strukt som säger att Context finns innan den är deklarerad class State { diff --git a/src/_main.cc b/src/_main.cc index 630aa2b..939b0e1 100644 --- a/src/_main.cc +++ b/src/_main.cc @@ -18,7 +18,7 @@ int main () sf::VideoMode{S_WIDTH, S_HEIGHT}, "DespYrat" }; - + //skapar en start meny Context game_context{}; game_context.current_state = std::make_unique(); @@ -37,13 +37,14 @@ int main () default: break; } - + //innehåller all spelstatus game_context.current_state->handle_input(event); } - // Update + // Update startmeny game_context.current_state->update(game_context); + //om vi har bytt så ska vi byta state, ex Esc hopp till paus meny if (game_context.next_state != nullptr) { game_context.current_state.release(); -- 2.30.2