GameClient now objects say to client that they have moved!

This commit is contained in:
lindaandersson 2014-02-20 10:33:27 +01:00
parent 9082666eba
commit e6cd1f1e5f
3 changed files with 2 additions and 3 deletions

View File

@ -300,6 +300,7 @@ bool Level::InitiateLevel(std::wstring levelPath)
Object* dynamicGameObj = CreateGameObj(dynamicObjData, rigidBody_Dynamic); Object* dynamicGameObj = CreateGameObj(dynamicObjData, rigidBody_Dynamic);
if (dynamicGameObj != NULL) if (dynamicGameObj != NULL)
{ {
dynamicGameObj->GetRigidBody()->SetSubscription(Level::PhysicsOnMoveLevel);
this->dynamicObjects.Push((DynamicObject*)dynamicGameObj); this->dynamicObjects.Push((DynamicObject*)dynamicGameObj);
} }
} }

View File

@ -30,7 +30,6 @@ Object::Object(Oyster::Physics::ICustomBody *rigidBody, void (*collisionFuncAfte
this->objectID = objectID; this->objectID = objectID;
this->extraDamageOnCollision = 0; this->extraDamageOnCollision = 0;
this->rigidBody->SetCustomTag(this); this->rigidBody->SetCustomTag(this);
this->rigidBody->SetSubscription((Oyster::Physics::ICustomBody::EventAction_Move)((Game*)&Game::Instance())->onMoveFnc);
} }
@ -42,7 +41,6 @@ Object::Object(Oyster::Physics::ICustomBody *rigidBody , Oyster::Physics::ICusto
this->objectID = objectID; this->objectID = objectID;
this->extraDamageOnCollision = 0; this->extraDamageOnCollision = 0;
this->rigidBody->SetCustomTag(this); this->rigidBody->SetCustomTag(this);
this->rigidBody->SetSubscription((Oyster::Physics::ICustomBody::EventAction_Move)((Game*)&Game::Instance())->onMoveFnc);
} }
Object::~Object(void) Object::~Object(void)

View File

@ -127,7 +127,7 @@ void Player::BeginFrame()
} }
if (key_forward <= 0.001 && key_backward <= 0.001 && key_strafeRight <= 0.001 && key_strafeLeft <= 0.001 && key_jump <= 0.001 ) //&& this->rigidBody->GetLambda() < 0.7f) if (key_forward <= 0.001 && key_backward <= 0.001 && key_strafeRight <= 0.001 && key_strafeLeft <= 0.001 && key_jump <= 0.001 && this->rigidBody->GetLambda() < 0.7f)
{ {
/* Dampen when on the ground and not being moved by the player */ /* Dampen when on the ground and not being moved by the player */
linearVelocity *= 0.2f; linearVelocity *= 0.2f;