This commit is contained in:
ViktorLjung
2014-03-13 21:42:28 +01:00
parent d6a0cdca58
commit 759302b789
5 changed files with 49 additions and 30 deletions
+17
View File
@@ -136,6 +136,23 @@ void Systems::PlayerSystem::UpdateEntity(double dt, EntityID entity, EntityID pa
else
freecamEnabled = true;
}
//powerup
auto collisionComponent = m_World->GetComponent<Components::Collision>(entity, "Collision");
for(auto ent : collisionComponent->CollidingEntities)
{
std::string name = m_World->GetProperty<std::string>(ent, "Name");
if(name == "PowerUp")
{
auto powerupComp = m_World->GetComponent<Components::PowerUp>(ent, "PowerUp");
if(powerupComp != nullptr)
{
transform->Velocity.z = powerupComp->Speed;
m_World->RemoveEntity(ent);
}
}
}
// Update camera