https://github.com/drshahinstein/c-snake-game
🐍 Snake game using C and Raylib
https://github.com/drshahinstein/c-snake-game
c c-game raylib raylib-c snake-game
Last synced: 29 days ago
JSON representation
🐍 Snake game using C and Raylib
- Host: GitHub
- URL: https://github.com/drshahinstein/c-snake-game
- Owner: DrShahinstein
- Created: 2024-02-03T17:10:51.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-01T12:09:34.000Z (about 2 years ago)
- Last Synced: 2025-01-13T07:11:28.744Z (over 1 year ago)
- Topics: c, c-game, raylib, raylib-c, snake-game
- Language: C
- Homepage:
- Size: 126 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Snake Game in C using Raylib
This has been the first project of mine where I used C and learned a lot.
## Keys
| Key | Func |
| ---------------- | ------------- |
| Space | Pause game |
| Enter | Unpause game |
| Enter | Restart game |
## Showcase
https://github.com/DrShahinstein/c-snake-game/assets/81323808/005fed72-1ef5-4db2-8dbf-11a335bdc867
## Build
See [releases](https://github.com/DrShahinstein/c-snake-game/releases/tag/LTS) to get executable binaries right away.
If you want to build from source, [raylib](https://github.com/raysan5/raylib) must be installed and maintained on your machine.
### Linux
Clone the repository and simply run `make` tool to build snake game in Linux.
```
$ git clone https://github.com/DrShahinstein/c-snake-game
$ cd c-snake-game/
$ make
$ make run
```
### Windows
Make sure you have [w64devkit](https://github.com/skeeto/w64devkit) installed on your machine.
Using w64devkit terminal, you can follow the exact same instruction with Linux.
```
$ git clone https://github.com/DrShahinstein/c-snake-game
$ cd c-snake-game/
$ make
$ make run
```
### Troubleshooting
In Windows, if you ever face an issue like raylib window not being initialized just as in here:

You can change the compatibility of the executable to run on Windows 8 or anything else if necessarry like this:
