diff options
author | Stijn Buys <ingar@osirion.org> | 2008-02-10 17:54:53 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-02-10 17:54:53 +0000 |
commit | 825d5a44bd312772c53fdaa8924e4009cfb320a3 (patch) | |
tree | a222232dee96bfe391eba819b1a18693db5bb3a4 /src/game | |
parent | 31959bc355c471c573828bf63932850e46c4b5bc (diff) |
more entity updates
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/game.cc | 27 | ||||
-rw-r--r-- | src/game/star.cc | 7 | ||||
-rw-r--r-- | src/game/star.h | 5 |
3 files changed, 31 insertions, 8 deletions
diff --git a/src/game/game.cc b/src/game/game.cc index 8a50e33..197700f 100644 --- a/src/game/game.cc +++ b/src/game/game.cc @@ -21,6 +21,7 @@ namespace game bool Game::init() { using math::Vector3f; + using math::Color; //using filesystem::IniFile; con_print << "Initializing game..." << std::endl; @@ -101,9 +102,35 @@ bool Game::init() star->location = Vector3f(256.0f, 0.0f, 256.0f); star->label = "star: Sabishi Hoshi"; + ship = new Ship(); ship->location = Vector3f(0,0,0); ship->label = "ship: Micron Vector"; + + core::Entity *cube = new core::Entity(core::entity::Solid & core::entity::Static); + cube->base_shape = core::entity::Cube; + cube->base_color = Color(0.0f, 0.8f, 0.0f); + cube->location = Vector3f(24.0f, 0.0f, -24.0f); + cube->label ="cube: Borg cube green"; + + cube = new core::Entity(core::entity::Solid & core::entity::Static); + cube->base_shape = core::entity::Cube; + cube->base_color = Color(1.0f, 0.0f, 0.0f); + cube->location = Vector3f(16.0f, 0.0f, -16.0f); + cube->label ="cube: Borg cube red"; + + core::Entity *sphere = new core::Entity(core::entity::Solid & core::entity::Static); + sphere->base_shape = core::entity::Sphere; + sphere->base_color = Color(0.8f, 0.8f, 0.0f); + sphere->location = Vector3f(0.0f, 0.0f, -32.0f); + sphere->label ="sphere: The Sphere"; + + core::Entity *axis = new core::Entity(core::entity::Static); + axis->base_shape = core::entity::Diamond; + axis->base_color = Color(1.0f, 1.0f, 0.0f); + axis->location = Vector3f(0, 0, 0); + axis->label = "axis: Origin"; + return true; } diff --git a/src/game/star.cc b/src/game/star.cc index 4ef22de..5fed82a 100644 --- a/src/game/star.cc +++ b/src/game/star.cc @@ -10,10 +10,11 @@ namespace game { -Star::Star() : core::Entity(0, star_enttype), - color(1,1,1,1) +Star::Star() : core::Entity(core::entity::Static & core::entity::Solid) { - radius = 48; + base_shape = core::entity::Sphere; // a star is a sphere + base_color = math::Color(1,1,1,1); // white + base_radius = 48; // 48 game units } Star::~Star() diff --git a/src/game/star.h b/src/game/star.h index 7a087d0..e953f3c 100644 --- a/src/game/star.h +++ b/src/game/star.h @@ -21,11 +21,6 @@ class Star : public core::Entity { public: Star(); ~Star(); - - math::Color color; - float radius; - - std::string name; }; } |