Add sun / moon, started on score / GameManager

This commit is contained in:
Bram Verhulst
2024-05-16 12:44:53 +02:00
parent 8866f33c09
commit 3c83e566dd
12 changed files with 176 additions and 35 deletions

View File

@@ -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);