blob: 92ba6f3292dc79497e68aaf4b4ff2da5995c1f7c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# Connect Four
A little Connect Four in C, built as a first go at driving SDL2 directly — window setup, loading BMP textures, mouse and keyboard events, a game loop that redraws every frame.
Two players share a mouse and keyboard: click a column to drop a disc, and a highlight bar follows the cursor across the top row so you can see which column you're about to drop into.
There's no actual four-in-a-row check anywhere in the code. Instead, whoever gets four in a row just presses a key to claim the win themselves, which bumps their score and starts a new round. Honor system instead of a win-condition scanner.
## Controls
- Click a column to drop a disc
- `R` — red claims a win
- `Y` — yellow claims a win
## Building
Needs SDL2 and SDL2_ttf.
```sh
make
./connect_four
```
## License
GPLv3 — see `LICENSE`.
|