You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
446 B

  1. function reversegame(dt)
  2. player1.height = ballSpeed/2
  3. player2.height = ballSpeed/2
  4. if (player1.y < ball[1].y)then
  5. player1.y = player1.y + ballSpeed/50
  6. elseif(player1.y > ball[1].y)then
  7. player1.y = player1.y - ballSpeed/50
  8. end
  9. if (player2.y < ball[1].y) then
  10. player2.y = player2.y + ballSpeed/50
  11. elseif(player2.y > ball[1].y) then
  12. player2.y = player2.y - ballSpeed/50
  13. end
  14. end