-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.h
47 lines (34 loc) · 1.37 KB
/
game.h
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
#pragma once
#include "SFML\Graphics.hpp"
#include "transform.h"
class Game {
public:
Game::Game(Transform* player);
void update(float delta);
void reset();
static float deltaTime();
static float timeSinceStart();
static float realTimeSinceStart();
static void startFinalBattle(AABB b);
static bool isInFinalBattle();
static glm::vec3 getFinalOrigin(); // returns origin of boss platform
static glm::vec3 getPlayerPos();
static void setRequiresWorldRegen(bool b);
static bool requiresWorldRegen();
static bool isGroundLava();
static float getLavaFlowRate();
static float getLavaTime();
private:
float finalBattleMusicTimer = 0.0f;
static Transform* player;
static Transform* lastBuilding;
static AABB building;
static sf::Clock time; // real life time in seconds since game started
static float timeCounter; // adds and stores all deltas for total game tick time
static float delta; // save latest delta time each frame for convenience
const float flowSpeed = 3.0f; // how long in seconds to start flowing
static float flowRate; // value from 0-1 denoting transition period
static float lavaTime; // how much lava has flowed
static bool inFinalBattle; // whether or in final battle stage
static bool reqRegen; // whether or not world should be regenerated
};