blob: d2b058dda7b76940580811dac7e13a7120b8a9b4 (
plain)
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
60
61
62
63
64
65
66
67
68
69
|
#include "gameCommon.h"
#include "gyroscope.h"
#include "radar.h"
#include "cameras.h"
#include "stars.h"
#ifndef GAME_SCREEN_H
#define GAME_SCREEN_H
#define GAME_SCREEN_TEXT_SIZE 20.0
#define GAME_SCREEN_NEXT_LEVEL_DELAY 4.0
#define GAME_SCREEN_TARGET_INFO_MAX 20
#define GAME_SCREEN_ZOOM_VIEW_SIZE 100 // Size it renders at.
#define GAME_SCREEN_ZOOM_VIEW_UI_SIZE 350 // Size on screen.
#define GAME_SCREEN_SKY_BOX_SIZE 1020.0
#define GAME_SCREEN_SHOW_GAME_OVER_FOR 4.0
#define GAME_SCREEN_GAME_OVER_FONT_SIZE 100
#define GAME_SCREEN_GAME_COMPLETE_SHOW_FOR 6.0
#define GAME_SCREEN_GAME_COMPLETE_FONT_SIZE 100
// Gui stuff and shit.
typedef struct GameScreen {
Vector2 infoTextPosition;
Vector2 targetInfoPosition;
Vector2 killLogPosition;
Gyroscope gyroscope;
Radar radar;
CameraId mainCamera;
bool levelComplete;
double timeAtLevelComplete;
int lastLevel;
int nextLevelInsultNum;
// Since the player entity gets reallocated each level we use this to remember its health.
float healthAtLevelEnd;
bool gameOver;
double gameOverAt;
bool gameComplete;
double gameCompleteAt;
RenderTexture zoomViewTexture;
Vector2 zoomViewPosition;
RenderTexture worldRender;
bool usingWorldRenderTexture;
Stars stars;
} GameScreen;
void initGameScreen(Game * game, GameScreen * gameScreen);
void freeGameScreen(GameScreen * gameScreen);
void updateGameScreen(Game * game);
void resizeGameScreen(Game * game, GameScreen * gameScreen);
void openGameScreen(Game * game);
// Call before setting screen when in game screen
void closeGameScreen(Game * game);
#endif
|