Mini Project Report 111sanke
Mini Project Report 111sanke
CERTIFICATE
ACKNOWLEDGEMENT
Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)
lOMoARcPSD|48990112
We have taken efforts in this project. However, it would not have been
possible without the kind support and help of many individuals and
organizations. We would like to extend my sincere thanks to all of them.
We are highly indebted to Mr.Pramit Sammant for his guidance and constant
supervision. Also, we are highly thankful to them for providing necessary
information regarding the project & also for their support in completing the
project.
We also express gratitude towards our parents for their kind cooperation and
encouragement which helped me in completion of this project. Our thanks and
appreciation also go to our friends in developing the project and all the people
who have willingly helped me out with their abilities.
Tushar Agrawal,
Yuvraj Jaiswal,
Prince Kumar Singh,
Sanskar Chhaparia
ABSTRACT
The Nokia inspired Snake game was implemented on 8051 platform. The
game is built on the AT89551 Microcontroller. The game uses an 8 8 LED
dot matrix display and five way keys for user interface. A dedicated delay
settings key provides one touch access to the delay settings mode where
the speed of the Snake can be adjusted.
Tushar Agrawal
Sanskar Chhaparia
Yuvraj Jaiswal
Table of Contents
Title Page
CERTIFICATE 1
ACKNOWLEDGEMENT 2
Downloaded by SANDEEP NISHAD (nishads9911@gmail.com)
lOMoARcPSD|48990112
ABSTRACT 3
TABLE OF CONTENTS 4
LIST OF TABLES 5
LIST OF FIGURES 6
CHAPTER 1: INTRODUCTION 8
CHAPTER 5: IMPLEMENTATION 21
5.1 Python
5.2 PY-GAME
5.3 Functional Description
REFERENCES 35
List of Tables
Title Page
List Of Figures
Title Page
Chapter 1: INTRODUCTION
Playing games is fun and exciting. It gives us relief from stress and unwinds
from our stressful work. Many of us spend our free time or others that use most
of their time in playing and exploring new games. Today, with the raped
development of technology we have, games that are rising up together with it.
Nowadays with technology we have many games that are developed for
computers specifically for windows. With the high technology equipped with
these 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 stake 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 (walls,
boundaries). As you collect the food, the stake gets longer. The score also
increases. There is no concept of life. Once you hit an obstacle, that's it, game
over.
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 1990's when 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' 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 cut a block. When you get the
block, the Snake grows an extra block or body segment.
If, or rather when, the snake bumps into the edge of the screen or accidentally
casts himself the game is over. The more blocks the snake eats the higher the
score.
2.2 MODULES
PyGame
Py game is a cross-platform set of python modules designed for
writing video games.
It includes computer graphics and sound libraries designed to be used
with the Python Programming language.
• To install the library, you can use pip installer from the command
line:
pip install pygame
import pygame
To play the game one controls a snake by selecting one of the cardinal
directions that the snake will move in. In order to score points you
must direct the snake to an apple, there is only one apple in the game
at time. The snake then eats the apple and increases in length by one
square or unit. The game ends when the snake runs into either the
boundaries of the play area or itself, the trailing snake body. The
domain provides a very interesting problem given that the snake
always moves after a given timing delay and the snake continually
grows in size. The delay is the feature that really makes the game
difficult because if you do not react fast enough the snake will
continue moving in the last direction given. This causes the player to
try to act as quickly as possible before the snake runs into an obstacle.
Also because the snake is constantly trailed by its tail(being the main
obstacle) any move taken cannot be undone or immediately back
tracked. So if you were to make a wrong turn into a dead end there is
no way to reverse that move to back out of the loop.
Although with every move your tail moves thus creating a situation
where a dead end or closed loop will no longer be a dead end after x
moves. The apple also can be very tricky since you cannot know
where the next apple position will be and this makes it difficult to go
straight for the current apple without thinking of how to get into a
good position for the next apple.
3.4 OBJECTIVE
Snake game is one of the most popular arcade games of all time.
In this game, the main objective of the player is to catch the
maximum number of fruits without hitting the wall or itself.
Creating a snake game can be taken as a challenge while learning
Python or Pygame. It is one of the best beginner – friendly projects
that every novice programmer should take as a challenge.
Learning to build a video game is kinda interesting and fun learning.
of the snake and the stake's body follows it around the screen. If the
snake "eats" food, it grows. The snake moves in a very precise way.
Based on what the user types, the snake will move in a given
direction. Every time the snake moves, the head will go in the new
direction, and every piece of the snake will move up, by occupying
the space that was formerly occupied by the piece in front of it.
• To grow in size, the snake has to eat food. How can we show the
snake eating? The simplest answer is that if the head of the snake and
the food are in the same place, we consider that the snake eats the
food. This means that we have to know where the food is. When it's
eaten, it disappears, the snake grows, and the food shows up
somewhere else. But we also wanted to show a score, so we need a
variable to keep track of that as well. In this case, we'll create a
Scoreboard class where we can increase the counter value and display
it.
I.Robustness:
Robustness is nothing but its ability to tolerate the effects of the
system's fictional body. And it can also be defined by its system’s
ability that it can withstand 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 247, Availability and Reliability are directly
proportional as reliability increases availability also increases. The ser
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 results or it has the
ability to provide better results.
4.4 SOFTWARE REQUIREMENT SPECIFICATION
4.4.1 SRS
Software Requirement Specification (SRS) is the starting point of the software
developing activity. As the system grew more complex it became evident that
the goal of the entire system cannot be easily comprehended. Hence the need for
the requirement phase arose. The software project is initiated by the client. The
SRS is the means of translating the ideas of the minds of clients (the input) into
a formal document (the output of the requirement phase) The SRS phase
consists of the activities.
4.4.3.Requirement Specification
Here, the focus is on specifying what has been found giving analysis such as
representation ,specification languages and tools, and checking the
specifications are addressed during this
The Requirement phase terminates with the production of the validate SS
document. Producing the SRS document is the basic goal of this phase.
CHAPTER 5: IMPLEMENTATION
5.1 PYTHON
Python's syntax and dynamic typing with its interpreted nature, make
it an ideal language for scripting and rapid application development in
many areas
Python supports multiple programming patterns, including object
oriented programming, imperative and functional programming or
procedural styles Python is not intended to work on special areas such
as web programming. That is why it is known as multipurpose
because it can be used with web, enterprise, 3D CAD ere We don't
need to use data types to declare variables because it is dynamically
typed so we can write a=10 to declare an integer value in a variable.
Python makes the development and debugging fast because there is
no compilation step included in python development and the edit-test-
debug cycle is very fast.
Python History
Python laid its foundation in the late 1980s. . The implementation of
Python was started in December 1989 by Guido Van Rossum CWI in
the Netherlands.
ABC programming language is said to be the predecessor of Python
language which was capable of Exception Handling and interfacing
with Amoeba Operating System.
Python is influenced by programming languages like
ABC language
Modula-3
Python Versions
Python programming language is being updated regularly with new
features and support. There are a lot of updates in python versions,
from 1994 to the current date.
A list of python versions with its date is given below.
5.2 PY-GAME
Installing pygame:
The first thing you will need to do in order to create games using
Pygame is to install it on your systems. To do that, you can simply use
the following command:
pip install pygame
5.3FUNCTION DESCRIPTION
Once that is done, just import Pygame and start our game
development. Before moving on, take a look at the Pygame functions
that have been used in this Snake Game along with their descriptions.
Function Description
set caption() Will set the caption test on the top of the display
screen.
font SysFont() Will create a Pygame font from the System font
resources.
1. Installing pygame
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 I
6. If the snake is over food, eat it, increase the score, grow, move the
food.
8. Go back to step 4
CHAPTER 6: TESTING
Note that the result of the system testing will prove that the system is
working correctly, It will give confidence to system designer, users of
the system.
How can we test a full Snake game and, assuming it passes that stage,
9. Many snake games increase the speed of the snake as it gets longer,
increasing the difficulty even further. This increased movement
speed gives a sense of urgency and can be a way to engage players
with the snake. But make it too fast and it becomes unplayable.
CHAPTER 7 : CONTRIBUTION OF
THE PROJECT TO THE SOCIETY
CHAPTER 8 : CONCLUSIONS
LIMITATIONS :
FUTURE SCOPE:
REFERENCES
https://www.edureka.co/blog/snake-game-with-pygame/
https://pypi.org/project/pygame/
https://www.edueba.com/python-pygame/
https://www.w3schools.com/python/module_random.asp
https://www.programmiz.com/python-programming/time