Fix the zoom! Finally!

main
sigonasr2 3 months ago
parent 530fdc7494
commit 946c329b37
  1. 10
      src/HamsterGame.cpp

@ -95,15 +95,9 @@ void HamsterGame::LoadLevel(const std::string_view mapName){
}
void HamsterGame::UpdateGame(const float fElapsedTime){
/*if(Hamster::GetPlayer().GetZ()>1.f){
tv.SetZoom(1/Hamster::GetPlayer().GetZ(),tv.WorldToScreen(Hamster::GetPlayer().GetPos()));
}else{
tv.SetZoom(1.f,tv.WorldToScreen(Hamster::GetPlayer().GetPos()));
}*/
camera.SetViewSize(tv.GetWorldVisibleArea());
camera.Update(fElapsedTime);
tv.SetWorldOffset(-SCREEN_FRAME.pos*(camera.GetViewSize()/SCREEN_FRAME.size)+camera.GetViewPosition());
tv.SetWorldOffset(tv.ScaleToWorld(-SCREEN_FRAME.pos)+camera.GetViewPosition());
Hamster::UpdateHamsters(fElapsedTime);
Powerup::UpdatePowerups(fElapsedTime);
border.Update(fElapsedTime);

Loading…
Cancel
Save