Submitted by : shrikrushna kalbande
Language : c
Downloader: 6
Posted on : 27-04-2019 11:49:59a

Download Code

This is a  simple Snake Game in C language. In this Mini Project Snake Game is simple  console application with graphics . In this project ,you can play the popular “Snake Game” just like you played it elsewhere. You have to use the up, down, right and left arrows to   move the snake I desired direction.

The game:-

  • Snake and Food  are placed on the screen.
  • Food is locate in different location after snake eating.
  • Snake move  in different direction by using up, down, right and left

Features:-

  • Excellent animation
  • Challenging objective to achieve
  • User friendly interface
  • Optimize for pc and smart-phones and tablets.
  • Cutting edge graphics
  • Excellent creativity
  • Beautiful theme
#include<stdlib.h>
#include<graphics.h>
#include<conio.h>
#define LEFT 75
#define RIGHT 77
#define UP 72
#define DOWN 80
#define Esc 27

int moveLeft(int*,int*,int,int,int,int,int);
int moveRight(int*,int*,int,int,int,int,int);
int moveUp(int*,int*,int,int,int,int,int);
int moveDown(int*,int*,int,int,int,int,int);
int io=0,size=2,up=0,down=0,left=0,right=1;
int foodx=0,foody=0,score=0,level=0;
void food();

void main()
{
    int i,x,y,ch,gd=DETECT,gm;
    initgraph(&gd,&gm,"c:\tc\bgi");

    setcolor(CYAN);
    settextstyle(3,0,5);
    outtextxy(150,30+60,"WELLCOME TO SNAKE GAME");
    outtextxy(150,50+80,"Press Any key start game");
    outtextxy(150,60+90,"Press Esc Exit Game");