From: stian853 Date: Mon, 13 Nov 2023 07:30:23 +0000 (+0100) Subject: la till lite kommentarer X-Git-Url: https://gitweb.forssennils.se/?a=commitdiff_plain;h=475d5e7f9d4f11a02ba3609742a2c29e8ac11ad5;p=TDDC76_proj.git la till lite kommentarer --- 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();