mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-16 20:41:47 +01:00
Fix camera, added more collsion stuff
added pink color
This commit is contained in:
@@ -21,7 +21,8 @@ WorldLevel::WorldLevel(Camera* camera, Rectf viewport):
|
||||
for (size_t x { 0 }; x < WORLD_WIDTH; ++x) {
|
||||
for (size_t y { 0 }; y < WORLD_HEIGHT; ++y) {
|
||||
int actualX = x - WORLD_WIDTH / 2;
|
||||
m_worldTiles[x][y] = new WorldTile{ Point2f{ float(actualX * TILE_WIDTH), -float(y * TILE_HEIGHT) - TILE_HEIGHT}, GroundTileTypes::Dirt, TextureManager::GetInstance()};
|
||||
Point2f pos = Point2f{ float(actualX * TILE_WIDTH), -float(y * TILE_HEIGHT) - TILE_HEIGHT};
|
||||
m_worldTiles[x][y] = new WorldTile{ pos, GroundTileTypes::Dirt, TextureManager::GetInstance() };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,6 +126,7 @@ void WorldLevel::ProcessImGui() {
|
||||
if(m_ShowCameraWindow) {
|
||||
ImGui::Begin("Camera", &m_ShowCameraWindow, ImGuiWindowFlags_AlwaysAutoResize);
|
||||
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});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user