]> git.tdb.fi Git - libs/game.git/blob - examples/bassteroids/source/gamecontroller.h
1f0d3cfdea9ec607a84aea3b8979f59f48bf6ae8
[libs/game.git] / examples / bassteroids / source / gamecontroller.h
1 #ifndef GAMECONTROLLER_H_
2 #define GAMECONTROLLER_H_
3
4 #include <random>
5 #include <msp/game/system.h>
6 #include "asteroid.h"
7
8 class GameController: public Msp::Game::System
9 {
10 private:
11         enum State
12         {
13                 LEVEL_START,
14                 PLAYING
15         };
16
17         std::minstd_rand rng;
18         AsteroidSetup asteroid_setup;
19         State state = LEVEL_START;
20         unsigned level = 1;
21         std::vector<Msp::Game::Owned<Asteroid>> asteroids;
22
23 public:
24         GameController(Msp::Game::Stage &);
25
26         void tick(Msp::Time::TimeDelta) override;
27 };
28
29 #endif