From d78117441cc53bef1033b49fe5dbbb989a2cafb6 Mon Sep 17 00:00:00 2001 From: Jason Hilder Date: Fri, 18 Sep 2026 07:23:59 +0200 Subject: [PATCH] Ball entity now emits event.s --- src/entity_ball.odin | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/entity_ball.odin b/src/entity_ball.odin index 9805549..1c31574 100644 --- a/src/entity_ball.odin +++ b/src/entity_ball.odin @@ -77,7 +77,9 @@ check_ball_paddle_collision :: proc(ball: Entity, paddle: Entity) -> bool { width = paddle.size.x, height = paddle.size.y, } - return rl.CheckCollisionCircleRec(ball.pos, ball.size.x, paddle_rec) + collided := rl.CheckCollisionCircleRec(ball.pos, ball.size.x, paddle_rec) + if collided do emit_event(Event{ type = .Ball_Collision }) + return collided } increment_score :: proc(score_side: ^int, max_score: int, player: bool) {