Learn how to program the simple and classic game of PONG. The whole game is based on 4 points :[br]the ball (A), the playing field (B, C) and the the playing pad (D) of length 2L
[b]This is the script associated with the button [i]Start[/i][/b][br]SetValue[in, false][br]SetValue[out, false][br]SetValue[score, 0][br]SetValue[speed, 0.2][br]SetValue[dx, 1][br]SetValue[dy, 1][br]SetValue[A, round((B+C)/2)][br]StartAnimation[][br][br][b]This is the script associated with the slider [i]time[/i][/b][br]SetValue[A, A+v*speed][br]If[x(A)<=x(B), SetValue[dx, abs(dx)]][br]If[x(A)>=x(C), SetValue[dx, -abs(dx)]][br]If[y(A)>=y(C), SetValue[dy, -abs(dy)]][br]If[y(A)<=y(B), If[x(A)>=x(D)-L && x(A)<=x(D)+L, SetValue[in, true],SetValue[out, true]]][br]If[in, SetValue[dy, abs(dy)]][br]If[in, SetValue[score, score+1]][br]If[in, SetValue[speed, speed+0.1]][br]If[out, StartAnimation[false]][br]SetValue[in, false]