Skip to content
How it works

How it works

This section explains the ideas behind Pelota: what the game computes, and why. Each page starts with the short version in plain words, then goes into the details with diagrams and plots. At the end of each page, a small In the code box points developers to the files that implement it.

The big picture

A match is a handful of parts that talk to each other:

The parts of a match and what they tell each other.
The parts of a match and what they tell each other.
  • The match manager knows the rules. It watches the ball, decides who wins each point, keeps the score and tells the players when to serve.
  • Each player has a controller that decides what the player does: where to move and which shot to play. A human controller turns your button presses into these decisions; the AI controller makes its own. Both drive the player in exactly the same way, so the AI has no special powers.
  • The ball flies by itself, following its own physics. The same physics can also predict the ball’s flight, which both controllers use to plan where to meet it.
  • The model is what you see of a player: the body, the clothes, the racket, and the animation that makes it all move.

Topics