CTravels replaces Sticky = true. Put "Travels" component on anything that should be moved down during travel sequences.

This commit is contained in:
PlatinumSkink
2015-10-15 11:11:06 +02:00
parent 44f2cf72ac
commit 4abce7b17f
12 changed files with 201 additions and 185 deletions
+4 -6
View File
@@ -31,15 +31,13 @@ void dd::Systems::TravellingSystem::Update(double dt)
void dd::Systems::TravellingSystem::UpdateEntity(double dt, EntityID entity, EntityID parent)
{
if (m_Travelling) {
auto transform = m_World->GetComponent<Components::Transform>(entity);
if (transform != nullptr) {
if (!transform->Sticky) {
auto travels = m_World->GetComponent<Components::Travels>(entity);
if (travels != nullptr) {
auto transform = m_World->GetComponent<Components::Transform>(entity);
if (transform != nullptr) {
transform->Position.y -= 6.0f * dt;
}
}
else {
transform->Position.y -= 6.0f * dt;
}
}
}