Änderung von Capter1 auf SDL3

This commit is contained in:
2025-11-02 16:26:43 +01:00
parent f4f9560fa9
commit 2aa3720d12
11 changed files with 59 additions and 38 deletions

View File

@@ -23,7 +23,7 @@ ball::ball(int x, int y, int vx, int vy)
alive = true;
rect = {x,y,20,20};
rect = {(float)x,(float)y,20,20};
color = {255,0,0,255};
}
@@ -53,9 +53,9 @@ void ball::Update(float f_DeltaTime, std::vector<ball> &list){
this->alive = false;
}
color.r += r_dir;
color.g += g_dir;
color.b += b_dir;
color.r += r_dir * (255.0f / 2.0f) * f_DeltaTime; // Richtung * (MaxWert / ZeitfensterFürAnimation) * Vergangene Zeit seit der Letzten Berechnung
color.g += g_dir * (255.0f / 2.0f) * f_DeltaTime;
color.b += b_dir * (255.0f / 2.0f) * f_DeltaTime;
//=================ColorCycle======================
// Clamp values between 1 and 254