-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameState.cs
57 lines (51 loc) · 1.49 KB
/
GameState.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
/*
* This is the GameState class, which will be used to keep track of the state of the game. In other
* words if the game is currently in play mode the GameState will switch to PlayState. Or if the user
* is in the menu the GameState will be in MenuState.
*
*
*********************
*Behaviors of states*
*********************
*
* TitleState
* -brings up the title screen to begin game
* -will intialize character and game once start is chosen
* -state will then switch to PlayState
*
* PlayState
* -game will continously run and character will react to buttons
*
* MenuState
* -game pauses so character and enemies will freeze while in menu
* -this state will also bring up the menu screen
* */
namespace PlatformerProject
{
class GameState
{
enum State {TitleState,
PlayState,
MenuState};
State currentState;
public GameState()
{
//Intializes the GameState to TitleScreen when game starts
currentState = State.PlayState; //switch to TitleState once a title screen is made
}
public State getCurrentState()
{
//get the current game state
return currentState;
}
public void setCurrentState(State state)
{
//changes the current game state to new current one
currentState = state;
}
}
}