-
Notifications
You must be signed in to change notification settings - Fork 0
/
state.c
59 lines (54 loc) · 1.32 KB
/
state.c
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
58
59
#include "main.h"
#include "state.h"
#include "ssmtf_logo.h"
#include "title_screen.h"
#include "team_select.h"
#include "gameplay.h"
#include "audio.h"
//#include "util.h"
//#include "assets/audio.h"
// transistions between game states
void transitionState(GAME_STATE newState)
{
jo_clear_screen();
switch(newState)
{
case GAME_STATE_SSMTF_LOGO:
{
playCDTrack(TITLE_TRACK);
ssmtfLogo_init();
g_Game.gameState = GAME_STATE_SSMTF_LOGO;
break;
}
case GAME_STATE_TITLE_SCREEN:
{
// if coming from SSMTF screen, don't restart the audio
if(g_Game.gameState != GAME_STATE_SSMTF_LOGO)
{
playCDTrack(TITLE_TRACK);
}
titleScreen_init();
g_Game.gameState = GAME_STATE_TITLE_SCREEN;
break;
}
case GAME_STATE_GAMEPLAY:
{
jo_audio_stop_cd();
g_Game.gameState = GAME_STATE_GAMEPLAY;
gameplay_init();
break;
}
case GAME_STATE_TEAM_SELECT:
{
jo_audio_stop_cd();
teamSelect_init();
g_Game.gameState = GAME_STATE_TEAM_SELECT;
break;
}
default:
{
return;
}
}
return;
}