blob: b5f32e6a07ee37a2bd2ade7f1785bf92730680df (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# pong
Pong in C and SDL2, two paddles, a ball, the whole game. There are two versions of it sitting side by side: `pong.c` is the first cut, and `game.c` is a cleaned-up revision that actually keeps score (`pong.c`'s scoring is stubbed out in comments) and eases up on how aggressively the ball speeds up on each bounce (1.1x per hit in `game.c` versus a much twitchier 1.5x in `pong.c`, which gets out of hand fast). `game.c` is the one worth running. `pong.c` is left in as the earlier draft.
## Controls
- Player 1: `W`/`S`
- Player 2: `I`/`K`
## Building
Needs SDL2 (and SDL2_ttf for `game.c`, unused at the moment but linked).
```sh
cc game.c -lSDL2 -lSDL2_ttf -o pong
./pong
```
|