https://github.com/codeslinger-alpha/snake-game-using-c
A basic snake game, made relying on pointers and 2D array.
https://github.com/codeslinger-alpha/snake-game-using-c
c pointers-and-arrays snake-game
Last synced: 3 months ago
JSON representation
A basic snake game, made relying on pointers and 2D array.
- Host: GitHub
- URL: https://github.com/codeslinger-alpha/snake-game-using-c
- Owner: codeslinger-alpha
- Created: 2024-09-09T15:04:42.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-10-03T11:09:55.000Z (9 months ago)
- Last Synced: 2025-03-31T03:47:06.602Z (3 months ago)
- Topics: c, pointers-and-arrays, snake-game
- Language: C
- Homepage:
- Size: 56.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
**Implementation of a basic snake game🐍, using pointers and 2D array.**
# Controls
Keys are **not case-sensitive**
`w`=up
`a`=left
`s`=down
`d`=right
`space`=pause/unpause
# Features
**Border wrapping**
### In the *source code*
```c
#define bgcolor 1
#define ROW 15
#define COL 30
int wait_time_ms=1000;//This is the maximum value
int border_wall;
char prev = 'd'; // primary direction of movement
const char snake_body = '=', point = 'o', OBSTACLE = '#'; // Visuals
```
-change `ROW` and `COL` to change the area
-set `bgcolor` to 1 or 0 to turn the background colour on or off
-change `wait_time_ms` to change frame speed
-change `prev` to change the direction in which the snake starts moving
-**you can change snake design also**
### After running the program
-Select level(speed)
-You can set boundary walls
-Set obstacles randomly
-Beep sound will play if you eat a point or when it's game over🎮
# Demo
## Screenshots
**Boundary**

**Border wrapping**

## Output
![]()