blob: ee55e5cee10c4a5a9069d1adf7e8dfcf25f285e3 (
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
## Tetris CSFML
[](https://travis-ci.org/Oxore/tetris-csfml)

This is unfinished tetris project written in pure C with CSFML library. It is under development. Basically I am learning some techniques and patterns for C and trying to use them here.


__Dependencies__
`SFML`
`CSFML`
`libyaml`
__Compilation and use__
Compilation:
```
make
```
File named "tetris" is the final binary. Run it. Hit *S* to start game.
- `S` - start a game.
- `Left arrow` - move shape left.
- `Right arrow` - move shape right.
- `Up arrow` - rotate shape clockwise.
- `Space` - hard drop.
- `P` - pause.
Force exclude producing test binary:
```
make NOTEST=1
```
Clean:
```
make clean
```
__Compilation with libs in prefix__
Probably your package manager does not have `SFML` and/or `CSFML` in repos.
You can build them in prefix and then specify `PREFIX` path when running `make`:
```
make PREFIX=$(pwd)/deps/prefix
```
It is better to use absolute path, so you can then put produced `tetris` binary to any other place and have prefix location unchanged.
__Windows__
Look at the [repo releases](https://github.com/Oxore/tetris-csfml/releases)!
Windows compilation flow currently is unsupported, but sometimes I put Windows binary releases there.
### TODO:
- Add screenshots and gameplay gif
- [x] Levels speed and scores calibration
- [x] Scoring system as in Tetris for NES which is described on [this page](https://tetris.wiki/Scoring)
- [x] [Wall kick](https://tetris.wiki/Wall_kick). Implemented order: left wall, right wall, floor
- [x] Hard drop
- [x] Phantom shape
- Table of records
- Settings menu with external `config.yml` file which allows
- Change key bindings
- Change colorscheme and define new
- Number of levels
- [x] Three next shapes
- [x] Pause
- Look with sprites and shaders
- Interprocess communication interface for control from other process (I want to connect machine learning algorithm and make it play and learn)
|