Add more ores

Add weighted random distribution
This commit is contained in:
Bram Verhulst
2024-04-22 22:34:29 +02:00
parent e578a77d84
commit e75b80eea8
25 changed files with 198 additions and 94 deletions

View File

@@ -58,6 +58,7 @@ void Game::ProcessKeyUpEvent(const SDL_KeyboardEvent& e) {
void Game::ProcessMouseMotionEvent(const SDL_MouseMotionEvent& e) {
m_MousePos = Vector2f { float(e.x), float(e.y) };
m_pCurrentLevel->MouseMove(Vector2f { float(e.x), float(e.y) });
}
@@ -83,6 +84,17 @@ void Game::ProcessMouseUpEvent(const SDL_MouseButtonEvent& e) {
// break;
//}
}
void Game::ProcessMouseWheelEvent(const SDL_MouseWheelEvent& e) {
Vector2f scroll = Vector2f { 0, 0 };
if (e.y > 0) {
scroll = Vector2f { 0, 1 };
}
else if (e.y < 0) {
scroll = Vector2f { 0, -1 };
}
//camera zoom
m_Camera.SetScale((m_Camera.GetScale() - e.preciseY * 0.1f));
}
void Game::ProcessImGui() {
m_pCurrentLevel->ProcessImGui();
}