]> git.tdb.fi Git - libs/game.git/blob - examples/bassteroids/source/ship.h
Add a controllable player ship to Bassteroids
[libs/game.git] / examples / bassteroids / source / ship.h
1 #ifndef SHIP_H_
2 #define SHIP_H_
3
4 #include <msp/game/meshsource.h>
5 #include "physicalentity.h"
6
7 struct ShipSetup
8 {
9         PhysicalSetup physical;
10         Msp::Game::MeshSourceSetup mesh;
11         float speed;
12         float turn_rate;
13 };
14
15 class Ship: public PhysicalEntity
16 {
17 public:
18         using Setup = ShipSetup;
19
20 private:
21         const Setup &setup;
22         Msp::Game::Owned<Msp::Game::MeshSource> mesh;
23
24 public:
25         Ship(Msp::Game::Handle<Msp::Game::Entity>, const Setup &);
26
27         const Setup &get_setup() const { return setup; }
28 };
29
30 #endif