Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/iambasantarai/saanp.vi

...
https://github.com/iambasantarai/saanp.vi

c makefile sdl2 snake-game vim-keys

Last synced: 8 days ago
JSON representation

...

Awesome Lists containing this project

README

        


saanp.vi

I developed this simple Snake Game using the SDL2 library in C.
I was inspired by a video on the [CS50](https://www.youtube.com/@cs50) YouTube channel, which demonstrated [2D Games in C using SDL](https://www.youtube.com/watch?v=yFLa3ln16w0).
The name **`saanp.vi`** (with 'saanp' meaning 'snake') playfully describes the snake-like behavior of my friends, while 'vi' refers to the Vim keybindings used for controls.

## Project setup

### Prerequisites

- [SDL2](https://www.libsdl.org/)
- C Compiler (gcc, g++ etc.)

#### Void linux

```bash
sudo xbps-install gcc SDL2 SDL2-devel -y
```

### Getting Started

Clone the repository

```bash
git clone [email protected]:iamsampang/saanp.vi.git
```

Navitage to the project directory

```bash
cd saanp.vi
```

Build the game using `make`

```bash
make
```

Run the game

```bash
./main.bin
```

## Controls

| KEY | ACTION |
| ----- | ------------- |
| `i` | start game |
| `h` | move left |
| `j` | move down |
| `k` | move up |
| `l` | move right |
| `esc` | quit the game |