mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-16 20:41:47 +01:00
Fix Collision add basic digging
This commit is contained in:
@@ -55,6 +55,14 @@ void WorldLevel::Update(float elapsedSec) {
|
||||
}
|
||||
|
||||
m_player.Update(elapsedSec, *this);
|
||||
|
||||
//Point2f playerPos = m_player.GetPosition();
|
||||
//Point2f newCameraPos = playerPos;
|
||||
//m_pCamera->SetPosition(newCameraPos);
|
||||
|
||||
//place the player in the center of the camera
|
||||
//m_pCamera->SetPosition(Point2f{playerPos.x - m_viewport.width / 2, playerPos.y - m_viewport.height / 2});
|
||||
|
||||
}
|
||||
void WorldLevel::Draw() const {
|
||||
m_pCamera->BeginRendering();
|
||||
@@ -128,7 +136,7 @@ void WorldLevel::ProcessImGui() {
|
||||
ImGui::Text("Camera Position: (%f, %f)", m_pCamera->GetPosition().x, m_pCamera->GetPosition().y);
|
||||
ImGui::Text("Is Right Mouse Down: %s", utils::isMouseDown(0) ? "true" : "false");
|
||||
if(ImGui::Button("Reset Camera")) {
|
||||
m_pCamera->SetPosition(Point2f{m_viewport.width / 2, m_viewport.height / 2});
|
||||
m_pCamera->SetPosition(Point2f{-m_viewport.width / 2, -m_viewport.height / 2});
|
||||
}
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user