Make your ball have a X- and Y-Speed, adding this values to the ball's position each frame
If it hits a wall, just flip the corresponding axis like so:
If ball_x_pos < 0 then ball_x_speed= -ball_x_speed
Use HUD_SetObjectOrigin (ball,0,0) to center the handle after loading/creating your ball.
If it hits a wall, just flip the corresponding axis like so:
If ball_x_pos < 0 then ball_x_speed= -ball_x_speed
Use HUD_SetObjectOrigin (ball,0,0) to center the handle after loading/creating your ball.