entity movement
This commit is contained in:
parent
09f84f9b03
commit
5a4412197d
1 changed files with 21 additions and 0 deletions
21
Game.cpp
21
Game.cpp
|
@ -230,6 +230,27 @@ void Game::Update(float deltaTime, float totalTime)
|
|||
// Example input checking: Quit if the escape key is pressed
|
||||
if (Input::GetInstance().KeyDown(VK_ESCAPE))
|
||||
Quit();
|
||||
|
||||
for (int i = 0; i < entities.size(); ++i)
|
||||
{
|
||||
entities[i]->GetTransform()->SetScale(0.1f * (i + 1), 0.1f * (i + 1), 0.1f * (i + 1));
|
||||
entities[i]->GetTransform()->SetRotation(0.1f * (i + 1) * sin(totalTime), 0.1f * (i + 1) * sin(totalTime), 0.1f * (i + 1) * sin(totalTime));
|
||||
// this range uses shapes[0] for testing
|
||||
if (i < 3)
|
||||
{
|
||||
entities[i]->GetTransform()->SetPosition(tan((double)totalTime * ((double)i + (double)1)) * 0.1f, 0, 0);
|
||||
}
|
||||
// this range uses shapes[1] for testing
|
||||
else if (i < 6)
|
||||
{
|
||||
entities[i]->GetTransform()->SetPosition(sin((double)totalTime * ((double)i + (double)1)) * 0.1f, 0, 0);
|
||||
}
|
||||
// this range uses shapes[2] for testing
|
||||
else
|
||||
{
|
||||
entities[i]->GetTransform()->SetPosition(sin((double)totalTime * ((double)i + (double)1)) * cos(totalTime) * 0.1f, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------
|
||||
|
|
Reference in a new issue