]> git.tdb.fi Git - libs/game.git/blob - examples/bassteroids/source/playfield.h
Add playfield boundaries to Bassteroids
[libs/game.git] / examples / bassteroids / source / playfield.h
1 #ifndef PLAYFIELD_H_
2 #define PLAYFIELD_H_
3
4 #include <msp/game/entity.h>
5 #include "physicalentity.h"
6
7 struct PlayfieldSetup
8 {
9         Msp::LinAl::Vector<float, 2> size;
10 };
11
12 class Playfield: public Msp::Game::Entity
13 {
14 public:
15         using Setup = PlayfieldSetup;
16
17 private:
18         struct Border
19         {
20                 PhysicalSetup setup;
21                 Msp::Game::Owned<PhysicalEntity> entity;
22
23                 Border(Playfield &, Msp::LinAl::Vector<float, 2>, Msp::LinAl::Vector<float, 2>);
24         };
25
26         const Setup &setup;
27         Border left;
28         Border right;
29         Border bottom;
30         Border top;
31
32 public:
33         Playfield(Msp::Game::Handle<Msp::Game::Entity>, const Setup &);
34 };
35
36 #endif