0% found this document useful (0 votes)
2 views13 pages

omkar MAD

The document outlines the development of a simple console-based Snake game using Python, where players control a snake to collect food while avoiding obstacles. It includes system and hardware requirements, functional and non-functional requirements, and a working algorithm for the game. Future enhancements may include improved graphics, player profiles, and multiplayer options.

Uploaded by

avhadsangharsh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views13 pages

omkar MAD

The document outlines the development of a simple console-based Snake game using Python, where players control a snake to collect food while avoiding obstacles. It includes system and hardware requirements, functional and non-functional requirements, and a working algorithm for the game. Future enhancements may include improved graphics, player profiles, and multiplayer options.

Uploaded by

avhadsangharsh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

TO DEVELOP A SNAKE GAME

ABSTRACT

Snake game is a simple console application without 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 or left arrows to move the snake. Foods are provided at the several co-
ordinates of the screen for the snake to eat.

Every time the snake eats the food, its length will by increased by one element along
with the score. I have used Python as Programming language for writing the code for
the project and VsCode for writing the programs. Operating system used Windows 10.

A.C.S.’S. DIPLOMA IN ENGG & TECH, ASHTI Page | 1


TO DEVELOP A SNAKE GAME

INTRODUCTION

Playing games is fun and exciting it gives us relief from stress and unwind from our
stressful works. Many of us spend our vacant time or others that use most of their time
in playing and exploring new games. Today, with the rapid development of technology
we have, games that are rising up together with it. Nowadays with the technology we
have many games that are developing for computer most specifically for windows.
With the high technology equipped with these computers, computer games become
robust and attract many people to buy or have this gadget for them to experience
what’s inside it which makes it a trend for the new generation of gadget.

Snake game is a computer action game; whose goal is to control a snake to move and
collect food in a map. It has been around since the earliest days of home computing
and has re-emerged in recent years on mobile phones.
It isn’t the world’s greatest game, but it does give you an idea of what you can achieve
with a simple python program, and perhaps the basis

By which to extend the principles and create more interesting games on your own.
To move the snake, use ‘up arrow’ for up, ‘down arrow’ for down, ‘left arrow’ for left
and ‘right arrow’ for right. Press ‘q’ to exit the game at any time, press ‘c’ to continue
the game.

The aim of the game is to collect the dots (food) and avoid the obstacles (crosses
borders). As you collect the food, the snake gets longer. The score also increases.
There is no concept of lives. Once you hit an obstacle, that’s it, game over.

A.C.S.’S. DIPLOMA IN ENGG & TECH, ASHTI Page | 2


TO DEVELOP A SNAKE GAME

LITERATURE SURVEY

The history of the Snake game goes back to the 1970's, the concept originated in the
1976 arcade game Blockade, and its simplicity has led to many implementations.
However, it was the 1980'swhen the game took on the look that we will be using. It
was sold under numerous names and many platforms but probably gained widespread
recognition when it was shipped as standard on Nokia mobile phones in the late 1990's.

The first published Nokia, for monochrome phones. It was programmed in 1997 by
Taneli Armanto of Nokia and introduced on the Nokia 6110.The game involves
controlling a single block or snakehead by turning only left or right by ninety degrees
until you manage to eat an block. When you get the block, the Snake grows an extra
block or body segment. If, or rather when, he snake bumps into the edge of the screen
or accidentally eats himself the game is over. The more blocks the snake eats the
higher the score.

A.C.S.’S. DIPLOMA IN ENGG & TECH, ASHTI Page | 3


TO DEVELOP A SNAKE GAME

SYSTEM DESIGN

To create a Snake game that allows users to control the movement of a snake on a
screen, to get points for eating food and avoiding running into the walls or the growing
tail of the snake itself. In this problem, we want to write a game where a graphical
representa tion of a snake moves across the screen.

When it encounters a piece of food, the snake grows longer and we gain a point. If it
hits the wall we die. To write this program we are going to need:

● A way of representing the snake


● A way of representing the food
● A way to display the score,
● a way for our instructions to reach the snake,
● and a way to know when we’ve run into something and died

Our system is going to involve working with both hardware and software, and so we
will need to understand what we have available in hardware that can assist us. If we
build our software so that the snake is controlled by directional arrows on the
keyboard.

Now that understand how our hardware will work in the design of our system, let’s
move on to starting the design of our software system.

A.C.S.’S. DIPLOMA IN ENGG & TECH, ASHTI Page | 4


TO DEVELOP A SNAKE GAME

SYSTEM AND HARDWARE REQUIREMENTS

SYSTEM REQUIREMENTS

 OPERATING SYSTEM : WINDOWS XP or Higher


 IDE : VisualStudio.NET 2005/2008 FRONT END : WINDOWS
 LANGUAGE : Python

HARDWARE REQUIREMENTS

Intel P4 1.5GHz or above 512MB RAM


80GB HDD Minimum

A.C.S.’S. DIPLOMA IN ENGG & TECH, ASHTI Page | 5


TO DEVELOP A SNAKE GAME

FUNCTIONAL REQUIREMENTS

Here are the requirements (functional requirements) for how the snake moves.

1. The snake must appear to move around the screen.

2. The snake must turn in response to user input.

3. The snake will increase in length if it eats food.

4. The snake will die if it runs into the walls.

5. The snake never stops moving.

A.C.S.’S. DIPLOMA IN ENGG & TECH, ASHTI Page | 6


TO DEVELOP A SNAKE GAME

NON-FUNCTIONAL REQUIREMENTS

The primary features of IT projects involve implementing like an application, a piece


of infrastructure, a patch. In this specific context functional requirements tells us about
what project does when interacted, whereas non-functional requirements describe
about the bounds of performance should be.

I. Robustness :
Robustness is nothing but its ability that it can tolerate the affects of system
functional body. And it can also be defined as its systems ability that it can
withstand to change without transforming its initial stable configuration

II. Reliability:
The system is trustworthy and it is consistently good in performance. It can also
be stated as the system performs the function without any failure under certain
conditions and specified period of time.

III. Availability:
The system is available 24*7. Availability and Reliability are directly
proportional as reliability increase availability also increases. The user can have
access to the system all the time.

IV. Reusability:
The system can be used any number of times by the specific user. and the
reusability is consistent, adaptable and stable.

V. Effectiveness:
The algorithm is capable of producing desired result or it has the ability to
provide better results.

A.C.S.’S. DIPLOMA IN ENGG & TECH, ASHTI Page | 7


TO DEVELOP A SNAKE GAME

WORKING ALGORITHM

Let's look at how a program to run the whole game might look:

1. Draw the playing area with bounding rectangle, set the counter to zero and
display it.

2. Draw the snake in a starting position.

3. Draw the food in a starting location.

4. On user input, change snake direction.

5. Move the snake one move

6. If the snake is over food, eat it, increase the score, grow, move the food,

7. else if the snake is over in a wall, die.

8. Go back to 4.

9. Until the snake die

A.C.S.’S. DIPLOMA IN ENGG & TECH, ASHTI Page | 8


TO DEVELOP A SNAKE GAME

SAMPLE OUTPUT

A.C.S.’S. DIPLOMA IN ENGG & TECH, ASHTI Page | 9


TO DEVELOP A SNAKE GAME

CONCLUSION

The project in python programming of Snake Game is a simple console application


with very simple 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, or left arrows to
move the snake.

Foods are provided at the several co-ordinates of the screen for the snake to eat. Every
time the snake eats the food, its length will increased by one element along with the
score.

It isn’t the world’s greatest game, but it does give you an idea of what you can achieve
with a relatively simple python programming, and perhaps the basis by which to
extend the principles and create more interesting games on your own.

A.C.S.’S. DIPLOMA IN ENGG & TECH, ASHTI Page | 10


TO DEVELOP A SNAKE GAME

FUTURE SCOPE

In this project, I have used simple application, this project will be able to implement in
future after making some changes and modifications as I made this project at low level.
The modifications that can be done in this project are:

1. It can be made with good graphics.

2. We can add more options like Top scores and Player Profile.

3. We can add multiplayer option.

A.C.S.’S. DIPLOMA IN ENGG & TECH, ASHTI Page | 11


TO DEVELOP A SNAKE GAME

 REFERENCES

1) Third year Mobile Application Development book


2) www.goolge .com
3) www.geeksforgeeks.com
4) www.scridb.com

A.C.S.’S. DIPLOMA IN ENGG & TECH, ASHTI Page | 12


TO DEVELOP A SNAKE
GAME

17

You might also like