Skip to content

codeslinger-alpha/Snake-Game-using-C

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 

Repository files navigation

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

#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
image
Border wrapping
image

Output

gameplay

About

A basic snake game, made relying on pointers and 2D array.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages