reset ball now clears trail effect.

This commit is contained in:
2026-10-08 07:43:21 +02:00
parent d6c52cecda
commit 404c320973
+2 -1
View File
@@ -36,6 +36,8 @@ reset_ball :: proc(ball: ^Entity) {
ball.pos = rl.Vector2{(VIEWPORT_W / 2), (VIEWPORT_H / 2)}
ball.vel = rl.Vector2{0,0}
ball.speed = 300
ball.trail_positions = {}
ball.trail_count = 0
}
update_ball :: proc(ball: ^Entity, level: ^Level, dt: f32) {
@@ -119,7 +121,6 @@ increment_score :: proc(score_side: ^int, max_score: int, player: bool, ball: ^E
score_side^ += 1
if score_side^ == max_score {
emit_event(Game_Over_Data{player})
ball.trail_count = 0
}
}