diff --git a/Code/Game/DanBiasGame/GameClientState/GameState.cpp b/Code/Game/DanBiasGame/GameClientState/GameState.cpp index 335162ad..254c3b59 100644 --- a/Code/Game/DanBiasGame/GameClientState/GameState.cpp +++ b/Code/Game/DanBiasGame/GameClientState/GameState.cpp @@ -483,7 +483,7 @@ void GameState::Protocol( ObjPos* pos ) if(privData->object[i]->GetId() == pos->object_ID) { privData->object[i]->setPos(world); - Oyster::Math::Float3 position = Oyster::Math::Float3(0, 605, 15); + Oyster::Math::Float3 position = Oyster::Math::Float3(0, 605, -15); if(pos->object_ID == myId) // playerobj { //printf("Move message recieved!"); diff --git a/Code/Game/GameLogic/Game.cpp b/Code/Game/GameLogic/Game.cpp index 29287f76..b76970b2 100644 --- a/Code/Game/GameLogic/Game.cpp +++ b/Code/Game/GameLogic/Game.cpp @@ -105,7 +105,10 @@ bool Game::NewFrame() if(this->players[i]->player) this->players[i]->player->EndFrame(); gameInstance.onMoveFnc(this->players[i]); } - + for (unsigned int i = 0; i < this->level->level->dynamicObjects.Size(); i++) + { + gameInstance.onMoveFnc(this->level->level->dynamicObjects[i]); + } return true; diff --git a/Code/Game/GameLogic/Level.cpp b/Code/Game/GameLogic/Level.cpp index e15d9efa..364972df 100644 --- a/Code/Game/GameLogic/Level.cpp +++ b/Code/Game/GameLogic/Level.cpp @@ -13,6 +13,8 @@ Level::Level(void) } Level::~Level(void) { + delete this->levelObj; + this->levelObj = NULL; } void Level::InitiateLevel(std::string levelPath) @@ -70,7 +72,7 @@ void Level::InitiateLevel(float radius) int offset = 0; for(int i =0; i< nrOfBoxex; i ++) { - rigidBody_TestBox = API::Instance().AddCollisionBox(Oyster::Math::Float3(0.5f, 0.5f, 0.5f), Oyster::Math::Float4(0, 0, 0, 1), Oyster::Math::Float3(0, 605 + i*5, -10), 5); + rigidBody_TestBox = API::Instance().AddCollisionBox(Oyster::Math::Float3(0.5f, 0.5f, 0.5f), Oyster::Math::Float4(0, 0, 0, 1), Oyster::Math::Float3(0, 605 + i*5, 10), 5); this->dynamicObjects.Push(new DynamicObject(rigidBody_TestBox,Object::DefaultCollisionBefore, Object::DefaultCollisionAfter, OBJECT_TYPE::OBJECT_TYPE_BOX)); this->dynamicObjects[i]->objectID = idCount++; diff --git a/Code/Game/GameLogic/Level.h b/Code/Game/GameLogic/Level.h index cc34408b..5219e52a 100644 --- a/Code/Game/GameLogic/Level.h +++ b/Code/Game/GameLogic/Level.h @@ -65,7 +65,7 @@ namespace GameLogic static void PhysicsOnMoveLevel(const Oyster::Physics::ICustomBody *object); - private: + //private: TeamManager teamManager; Utility::DynamicMemory::DynamicArray> staticObjects; Utility::DynamicMemory::DynamicArray> dynamicObjects;