Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
2Activity
0 of .
Results for:
No results containing your search query
P. 1
Snake Game In C

Snake Game In C

Ratings: (0)|Views: 51|Likes:

More info:

Published by: Amandeep Singh Khera on May 27, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

05/27/2011

pdf

text

original

 
TABLE OF CONTENTS
1.Introduction2.Proposed systemi.Descriptionii.System requirements3.Requirement Analysis4.System Design5.Source code6.Testing7.Future scope of project
 
INTRODUCTION
The following is an example game written in C based on the game called'snake' which has been around since the earliest days of home computing (Ican remember writing a version of it for my ZX81), and has re-emerged inrecent years on mobile phones.It isn't the world's greatest game, but it does give you an idea of what youcan achieve with a relatively simple C program, and perhaps the basis bywhich to extend the principles and create more interesting games of your own.
.
 
Playing the game
You can download the executable to try out the game without having tocompile it if you wish. Download it byclicking here- it is about 123k inlength.Note that on faster PCs, it will be unplayably fast, so you will need tore-compile it with the pause_length constant set to a higher value. My PC isabout 350MHz and it is OK.To move the snake, use 'a' for up, 'z' for down,'o' for left and 'p' for right. Again, there are constants you can change if youwant to alter these settings. Press 'x' to exit the game at any time.The aim of the game is to collect the dots (food) and avoid the obstacles(crosses, borders, and the snake itself). As you collect food, the snake getslonger, so increasing your likelihood of crashing into yourself. When youhave collected enough food, you progress onto the next level, where your snake gets longer, and the amount of food to collect to progress through thelevel gets larger.You get scored according to the length of the snake and thenumber of 'x' obstacles on the screen.The speed increases every 5 levels.Youget a bonus when you complete the level of 1000, increasing by 1000 eachlevel (e.g. complete level 5, you get a 5000 bonus).There is no concept of lives. Once you hit an obstacle, that's it, game over.Make sure you do nothave the caps lock on, otherwise the keys will fail to respond

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->