mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-19 02:09:19 +01:00
Add sun / moon, started on score / GameManager
This commit is contained in:
@@ -67,6 +67,8 @@ WorldLevel::WorldLevel(Camera* camera, Rectf viewport): Level(camera),
|
||||
|
||||
m_MainScreen = new MainScreen(TextureManager::GetInstance());
|
||||
|
||||
m_Sun = new OrbitingObject(Vector2f{0, -1000}, 1200, 0.5f, TextureManager::GetInstance()->GetTexture("sun.png"));
|
||||
m_Moon = new OrbitingObject(Vector2f{0, -1000}, 1200, 0.5f, TextureManager::GetInstance()->GetTexture("moon.png"), M_PI);
|
||||
|
||||
}
|
||||
WorldLevel::~WorldLevel() {
|
||||
@@ -86,6 +88,9 @@ void WorldLevel::Update(float elapsedSec) {
|
||||
// m_gridManager.GetTileAtIndex(x, y)->m_Hightlight = false;
|
||||
// }
|
||||
// }
|
||||
|
||||
m_Sun->Update(elapsedSec);
|
||||
m_Moon->Update(elapsedSec);
|
||||
|
||||
for (int x { 0 }; x < WORLD_WIDTH; ++x) {
|
||||
for (int y { 0 }; y < WORLD_HEIGHT; ++y) {
|
||||
@@ -179,6 +184,9 @@ void WorldLevel::Draw() const {
|
||||
utils::SetColor(Colors::GREEN);
|
||||
utils::DrawArrow(Vector2f{0, 0}, m_MousePos);
|
||||
|
||||
m_Sun->Draw();
|
||||
m_Moon->Draw();
|
||||
|
||||
m_pCamera->EndRendering();
|
||||
|
||||
utils::FillRect(utils::GetMousePos(), 10, 10);
|
||||
|
||||
Reference in New Issue
Block a user