Ball entity now emits event.s
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user