https://github.com/olzhasar/sdl-tetris
Tetris game implemented with C and SDL-2
https://github.com/olzhasar/sdl-tetris
c emscripten emscripten-game game sdl sdl2 tetris wasm webassembly
Last synced: 5 months ago
JSON representation
Tetris game implemented with C and SDL-2
- Host: GitHub
- URL: https://github.com/olzhasar/sdl-tetris
- Owner: olzhasar
- License: mit
- Created: 2021-02-13T11:05:09.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-25T17:04:41.000Z (over 2 years ago)
- Last Synced: 2024-01-25T18:28:14.665Z (over 2 years ago)
- Topics: c, emscripten, emscripten-game, game, sdl, sdl2, tetris, wasm, webassembly
- Language: C
- Homepage: https://olzhasar.github.io/sdl-tetris/
- Size: 1.54 MB
- Stars: 20
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SDL Tetris
An implementation of the classic [Tetris game](https://en.wikipedia.org/wiki/Tetris) in the C programming language using the [SDL-2 library](https://www.libsdl.org/)
## WebAssembly
The game has been ported to WebAssembly using [Emscripten](https://emscripten.org/)
Check out the [Live Demo](https://olzhasar.github.io/sdl-tetris/)
## Desktop preview

## Installation
1. Clone this repository to your system:
```sh
git clone https://github.com/olzhasar/sdl-tetris.git
```
2. [Install](https://wiki.libsdl.org/SDL2/Installation) SDL2 and SDL2_ttf on your machine
- On MacOS you can use Homebrew:
```sh
brew install sdl2 sdl2_ttf
```
3. Compile and run the project code with make
```sh
cd sdl-tetris
make
```
## Controls
- Rotate: Up arrow, W
- Move Left: Left arrow, A
- Move Right: Right arrow, D
- Soft Drop: Down arrow, S
- Hard drop: Space
- Quit: ESC
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.