Kolizja Movment V2
This commit is contained in:
7
main.cpp
7
main.cpp
@@ -85,10 +85,9 @@ std::time_t monitormodehelper;
|
||||
FPSCounter fpsCounter;
|
||||
static const int targetFPS = 144; // Celowany FPS
|
||||
//Fps counter
|
||||
|
||||
void LimitFPS(int targetFPS) {
|
||||
static auto lastTime = std::chrono::steady_clock::now();
|
||||
auto currentTime = std::chrono::steady_clock::now();
|
||||
static auto lastTime = std::chrono::high_resolution_clock::now();
|
||||
auto currentTime = std::chrono::high_resolution_clock::now();
|
||||
std::chrono::duration<double> elapsed = currentTime - lastTime;
|
||||
|
||||
// Obliczamy czas na jedną klatkę
|
||||
@@ -118,7 +117,7 @@ float MoveSpeed = 1.0f; // Prędkość poruszania się
|
||||
|
||||
|
||||
float velocity = 0.0f; // Aktualna prędkość łazika
|
||||
const float friction = 0.05f; // Współczynnik tarcia (μ)
|
||||
const float friction = 0.1f; // Współczynnik tarcia (μ)
|
||||
const float maxSpeed = 3.0f; // Maksymalna prędkość łazika
|
||||
const float acceleration = 0.2f;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user