reset ball now clears trail effect.
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user