Lifebuoy updated, now dies after 4 hits

This commit is contained in:
viktorljung
2015-10-08 21:51:43 +02:00
parent d5e7481866
commit 9fe2324913
22 changed files with 12146 additions and 10 deletions
+3 -1
View File
@@ -297,7 +297,9 @@ bool dd::Systems::BallSystem::Contact(const Events::Contact &event)
} // Lifebuoy should always reflect the ball upwards
else if (m_World->GetProperty<std::string>(otherEntitiy, "Name") == "Lifebuoy"){
ballTransform->Velocity = glm::vec3(ballTransform->Velocity.x, abs(ballTransform->Velocity.y), ballTransform->Velocity.z);
Events::LifebuoyHit e;
e.Lifebuoy = otherEntitiy;
EventBroker->Publish(e);
} else {
auto it = m_Contacts.find(ballEntity);
if (it == m_Contacts.end()) {