Added plants. Added game time management.
This commit is contained in:
@ -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 */
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user