Added plants. Added game time management.

This commit is contained in:
2016-12-09 22:33:47 +02:00
parent c12a8ede5a
commit 2bd8605711
30 changed files with 645 additions and 87 deletions

View File

@ -139,6 +139,11 @@ void Grid::set(model::GameObject* obj, int x, int y, bool throwOnOverwrite)
}
m_grid[index] = obj;
// Set transform as well
Transform* transf = obj->component<Transform>();
transf->x = x;
transf->y = y;
}
} /* namespace basic */

View File

@ -67,9 +67,9 @@ namespace basic {
// Operations
model::GameObject* get(int x, int y);
void set(model::GameObject* obj, int x, int y, bool throwOnOverwrite = true);
private:
void set(model::GameObject* obj, int x, int y, bool throwOnOverwrite);
utils::Rect<int> m_bounds;
model::GameObject** m_grid;

View File

@ -64,7 +64,7 @@ void Sprite::dump(unsigned level)
void Sprite::onPreRender()
{
advanceTime(GameState::current().elapsedTime);
advanceTime(GameState::current().deltaTime);
}
void Sprite::addState(const SpriteState& state)