0% found this document useful (0 votes)
31 views

Project Z

This document provides a project report on creating a new game called "Zombie Attack" using Python and the classic game Pong. It discusses the aim of creating this new game by learning Python programming basics. The project involves developing the classic Pong game and then enhancing it to "Zombie Attack" by adding zombie characters and gameplay elements. The report outlines the Python course taken to learn the necessary skills and provides details of the project methodology, requirements, algorithms, programming steps, and results. It evaluates the learning outcomes and indicates potential for further enhancements to the game.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Project Z

This document provides a project report on creating a new game called "Zombie Attack" using Python and the classic game Pong. It discusses the aim of creating this new game by learning Python programming basics. The project involves developing the classic Pong game and then enhancing it to "Zombie Attack" by adding zombie characters and gameplay elements. The report outlines the Python course taken to learn the necessary skills and provides details of the project methodology, requirements, algorithms, programming steps, and results. It evaluates the learning outcomes and indicates potential for further enhancements to the game.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

A

Project Report
On

“CREATING A NEW GAME: ‘ZOMBIE ATTACK’ USING PYTHON AND


THE CLASSIC GAME PONG ”

Submitted to
CHHATTISGARH SWAMI VIVEKANAND TECHNICAL UNIVERSITY
BHILAI
In partial fulfillment of requirement for the award of degree
Of
Bachelor of Engineering
In
Electronics and Telecommunication EngineeringEngineering
By
JAINENDRA SHRIVASTAVA
301602819021

Electronics & Telecommunication Department

GOVT. ENGINEERING COLLEGE, RAIPUR


Old Dhamatari Road, Sejbahar, Raipur (C.G.) 492015
Office:0771-2103147, website: www.gecraipur.ac.in Email: [email protected]

SESSION 2021-22
DECLARATION

I Solemnly declare that the report of the project work entitled “Making a classic game Pong
using Python ” is based on my own work carried out during the course of my study under the
supervision of Prof. Mr. Manjeet Singh Sonwani Sir Department of Electronics and
Telecommunication Engg., NGEC Raipur.

I assert that the statement made and conclusions drawn are on outcomes of the project
that to the best of my knowledge and belief that the report does not contain any part of my work
which has been submitted for the award of any other degree/diploma certificate in this University
or any other University.

Jainendra Shrivastava
Roll No. : 301602819021
Enrollment No. : BH3051
CERTIFICATE
This is to certify that the report of the report of the project submitted is an outcome of the project
work titled “CREATING A NEW GAME:’ZOMBIE ATTACK’ SUING PYTHON AND THE
CLASSIC GAME PONG” carried out by Jainendra Shrivastava bearing Roll No.:301602819021
and Enrollment No.:BH3051 carried out under my guidance and supervision for the award of
degree in Bachelor of Engineering in Electronics & Telecommunication Engineering of
Chhattisgarh Swami Vivekanand Technical University, Bhilai (C.G.), India.
To the best of my knowledge the report
• Embodies the work of the candidate him/herself.
• Has duly been completed,
• Fulfills the requirement of the Ordinance relating to the B.E. degree of the
University and
• Is up to the desired standard for the purpose of which it is submitted.

(Signature of the Guide)


Prof. Mr. Manjeet Singh Sonwani
Department of ET&T
New GEC Raipur, Old Dhamtari Road,
Sejbahar, Raipur (C.G.) 492015

This project work as mentioned above is hereby recommended and forwarded for examination
and evaluation to Chhattisgarh Swami Vivekanand Technical University, Bhilai (C. G.)

(Signature of Head of Department with seal)


Acknowledgement
I thank the almighty for giving me the courage and perseverance in completing the project. This
project itself is acknowledgement for all those people who have given me their heartfelt
cooperation in making this project a success.
With extreme jubilant and deepest gratitude, I would like to thank the Head of the Department, for
his constant encouragement. I am greatly indebted to project guide Assistant Professor,
Electronics and Telecommunication Engineering, for providing valuable guidance at every stage
of this project work. I am profoundly grateful towards the unmatched services rendered by the
teachers .
My special thanks to my project guide Prof. Mr. Manjeet Singh Sonwani , Associate Professor,
Electronics and Telecommunication Department, for his support and valuable suggestions
regarding project work and my special thanks to all the faculty of Electronics and
Telecommunication Department and peers for their valuable advises at every stage .
Last but not the least, I would like to express my deep sense of gratitude and earnest thanks giving
to my dear parent for their moral support and heartfelt cooperation in doing the project.

(Signature of the student)


Jainendra Shrivastava
CERTIFICATE BY THE EXAMINERS
This is to certify that the project work entitled “Creating a new game: ‘ZOMBIE ATTACK’
using python and the classic game Pong”
Submitted by
Jainendra Shrivastava bearing Roll No. :301602819021 and Enrollment No. : BH3051
Has been examined by the undersigned as a part of the examination for the award of Bachelor of
Engineering Degree in Electronics and Telecommunication branch of Chhattisgarh Swami
Vivekanand Technical University, Bhilai (C.G.)

Internal examiner External examiner


Date: Date:
Table of Contents
S.NO. TITLE
1.INTRODUCTION
2.PROJECT:Creating a new game: ’ZOMBIE ATTACK’ using python & the classic game Pong.
➢ Aim
➢ Description
3.COURSE: “Python for beginners”
➢ Overview
➢ Features of Python Programming
➢ Hardware & Software requirement
➢ Python installation
➢ Brief explanation of each lessons:
❖ Python variables
❖ Python numbers
❖ Lists
❖ Python Tuples
❖ Strings in Python
❖ Python dictionaries and sets
❖ If, Else statements in python
❖ Python loops
❖ For loop in Python
❖ While loop in Python
❖ Arrays in Python
❖ Functions in Python
❖ Objects and Classes in python
❖ Threading in Python
❖ Turtle Library
4.PROJECT:Creating a new game: ’ZOMBIE ATTACK’ using python & the classic game
Pong .
➢ Methodology
➢ Hardware & Software requirements
➢ Flowchart and Algorithms
➢ Explanation of programming steps
➢ Complete Program
➢ Result and Discussions
➢ Conclusion & Scope of further work.
5.BIBLIOGRAPHY
6.CERTIFICATE COPY
KO

UNIT-1
INTRODUCTION
UNIT – 2
PROJECT: “Creating a
new game: ‘ZOMBIE
ATTACK’ using python &
the classic game Pong”.
–3
UNIT-3
UNIT
COURSE: “Python
for beginners”
COURSE: “Python
for beginners”
UNIT – 4
PROJECT: “Creating a
new game: ‘ZOMBIE
ATTACK’ using python
and the classic game
Pong”
]

UNIT – 5
Bibliography
UNIT – 6
Certificate Copy
INTRODUCTION
Nowadays, we are surrounded by many electronic gadgets and devices like smart phones,
washing machine, air conditioner, automatic driverless vehicles , industrial and humanoid robots
like Asimov, and a lot more stuffs which are made using the scientific and mathematical skills.
Software opens a wide range of applications to create virtual platform for doing many things like
playing games , doing animations, businesses, writing , communications, information storing and
sharing, entertainment, etc.
As software is a collection of programs and data files that are designed to perform
some operations. We have a lots of programming language to create any software for any purpose .
Some of the most popular are Python, JavaScript, Java, PHP, C#, C++, C, and so on.
Today, Python is considered as one of the most dynamic as well as robust programming
languages. It is easy to learn and has a code readability and a syntax which makes it easy to use as
it needs lesser lines of code than other programming languages like C++ and Java to complete a
task.
Python is an interpreted programming language which is object oriented used for general purpose
programming. Python can be used in a variety of operating systems such as mac, windows, Linux,
UNIX, etc.

My summer training course was to learn the python language at beginner level, and to create a
project : “Creating a new game: ‘ZOMBIE ATTACK’ using python and the classic game Pong”
based on my learning from this course.
Throughout this thesis ‘PROJECT: “Creating a new game: ‘ZOMBIE ATTACK’ using python
and the classic game Pong” , Firstly, I will give an overview of the course lessons of my online
training course on “ Python for beginners ”, and then I will bring my project of making the classic
game Pong and the new game Zombie Attack by my own at the end using python programming.
AIM

The aim of my project is to make the classic game PONG and a new game ‘ZOMBIE ATTACK’
using the python programming language and to discover the basic of creating a game in python or
any other programming language.
DESCRIPTION

‘ PONG ‘ is one of the first computer games that ever created, this simple tennis like
game features two paddles and a ball, the goal is to defeat your opponent by being the first one to
gain 10 point, a player gets a point once the opponent misses a ball hit by the paddle . The game
can be played with two human players or one player against a computer controlled paddle. The
game was originally developed by Allan Alcorn and released in 1972 by Atari corporations. Soon,
Pong became a huge success, and became the first commercially successful game, on 1975, Atari
release a home edition of Pong which sold 150,000 units. Today, the Pong Game is considered to
be the game which started the video games industry, as it proved that the video games market can
produce significant revenues.

Making the Pong game using Python requires a few pages of code. And as Python
comprises of many libraries for creating a Graphical User Interface (GUI) page by accessing many
functions from it, creating this game will be easier, since we do not need to know and work on the
hardware setups. The Turtle library function in Python has been used in the creation of these game.
Further a few methods that are used in the game Pong is utilized in the creation of a
new game ‘ZOMBIE ATTACK’. In this game whenever the dice is rolled, the red block
representing zombie spreads a step forward and the green block representing player moves the
amount of steps that has appeared on the dice. There are few buildings(hurdles) that comes along
the path of the player, over which the player cannot jump directly instead have to enter the building
and needs the number on the dice rolled to be greater than the number of floors present in the
building. The player wins the game if the player reaches the end of the path before the attack of
the zombies to convert the player itself into a zombie,
OVERVIEW

Throughout the course the topics covered are as follows:


• Data types, variables, list, tuples, dictionaries and more.
• Decision making statements and loops in Python.
• How to create user-defined functions.
• Object oriented programming concepts.
• Threading and Python scripting.
• Machine learning libraries available in Python.
FEATURES OF PYTHON PROGRAMMING

1.Easy to code:
Python is a high-level programming language. Python is very easy to learn the language as
compared to other languages like C, C#, JavaScript, Java, etc. It is very easy to code in python
language and anybody can learn python basics in a few hours or days. It is also a developer-
friendly language.

2. Free and Open Source:


Python language is freely available at the official website and you can download it from there.
Since it is open-source, this means that source code is also available to the public. So you can
download it as, use it as well as share it.

3 Object-Oriented Language:
One of the key features of python is Object-Oriented programming. Python supports object-
oriented language and concepts of classes, objects encapsulation, etc.

4. GUI Programming Support:


Graphical User interfaces can be made using a module such as PyQt5, PyQt4, wxPython, or Tk
in python.
PyQt5 is the most popular option for creating graphical apps with Python.

5. High-Level Language:
Python is a high-level language. When we write programs in python, we do not need to
remember the system architecture, nor do we need to manage the memory.

6. Extensible feature:
Python is a Extensible language. We can write us some Python code into C or C++ language and
also we can compile that code in C/C++ language.

7. Python is Portable language:


Python language is also a portable language. For example, if we have python code for windows
and if we want to run this code on other platforms such as Linux, Unix, and Mac then we do not
need to change it, we can run this code on any platform.
8. Python is Integrated language:
Python is also an Integrated language because we can easily integrated python with other
languages like C, C++ etc.

9. Interpreted Language:
Python is an Interpreted Language because Python code is executed line by line at a time. like
other languages C, C++, Java, etc. there is no need to compile python code this makes it easier to
debug our code. The source code of python is converted into an immediate form
called bytecode.

10. Large Standard Library


Python has a large standard library which provides a rich set of module and functions so you do
not have to write your own code for every single thing. There are many libraries present in
python for such as regular expressions, unit-testing, web browsers, etc.

11. Dynamically Typed Language:


Python is a dynamically-typed language. That means the type (for example-int, double, long,
etc.) for a variable is decided at run time not in advance because of this feature we don’t need to
specify the type of variable.
HARDWARE AND SOFTWARE REQUIREMENTS

Hardware requirement:
• An operating system with Linux, Window 7 or higher.
• Hard disk space of 250 GB or more.
• RAM 8 GB or more.

Software requirement:
• Having a Browser like Google Chrome or Internet Explorer with JavaScript enabled in it.
• Also it is recommended to have a text editor such as Notepad or Notepad++.
• Install python 3 and related packages.
• Also it will be good to have an IDE like Jupyter or pycharm.
PYTHON INSTALLATION

o Open the Browser and search Python.


o Click “ Welcome to Python.org
o Download Python version 3.7.1
o Open Set up page
o We need to install it. But before that click Add Python 3.7 to Path. What this does is it
ensures access python just by entering name Python without going to the path.
Go to yes. Then the installing process gets over.
BRIEF EXPLANATION TO EACH LESSON

PYTHON VARIABLES:
▪ Variables are entities of a program that hold a value.
Like, x = 100
▪ Data type is the type of value you assign to the variable .
▪ Integers are numbers without decimal points.
▪ Float are numbers with decimal point.
▪ Strings are characters set.

Program:

x = 100
type(x)
x = 654*6734
type(x)
print(x)
x = 3.14
type(x)
print(x)
x = “Pong”
type(x)
print(x)
Rules for naming variables :
• Variable name should begin with an alphabet or underscore.
• The first character can be followed by alphabets, number or underscore.
• Variable name are case sensitive. a100 is different from A100.
• Reserved words cannot be used a variable names
like break, day try, cannot be used as the variable names .
Python Numbers
• Variables of numeric types are created when you assign a value to them.
• There are three distinct numeric types: Integers, floating point numbers and complex
umbers.

Lists

• A list is a collection of data. It can held values of multiple data types.


• X = [1 89 A Hey O B ]
• Indices: 0 1 2 3 4 5

Python Numbers LISTS


Python Tuples
• A Tuple is a collection of immutable heterogenous python object.
• In python we use parentheses in Tuples and square bracket in lists/arrays.
• X = 1 89 A hey O B
• Indices: 0 1 2 3 4 5
Strings in Python
• A string is a datatype in Python, composed of a collection of characters. For example ,
“Simplilearn”, “Version 1.1”.
Python Dictionaries & Sets
• Dictionary is an unordered collection of data stored as a pair of key and value.
• Syntax:
Variable_name = {key1:value1, key2:value}
• Set is an unordered collection of unique elements.
• Syntax:
Variable_name = set([‘a’, ’b’, ’c’, ’d’])
If, else statements in Python

• If, else is a decision making statement.


• If statement
Syntax- if condition:
Statements to execute if the condition is true.

• If Else statement
Syntax: if condition:
Executes this block if the condition is true.
else:
Executes this block if the condition is false..

• Nested if statement
Syntax: if condition 1:
Executes if condition 1 is true.
if condition 2:
Execute if condition 2 is true
Condition 2 ends here.
Condition 1 ends here.
• If – Elif – Else statements
Syntax: if condition:
Executes the if condition statements.
elif condition:
Executes the elif condition statements.
else:
Else statements.
Python loops
• A loop is an instruction that repeats multiple times as long as some condition is met.

For loop in Python


• For loop is used to iterate over a sequence which could be a list, tuple, array or sting.
• Syntax:
for counter in sequence:
Statements.
While loop in python
• While loop is used to repeat a section of code an unknown number of times until a specific
condition is met.
• Syntax:
while expression:
statements.
Nested loops
• Python allows loops to be nested in loops.
Nested loops could be:
❖ For in for
Syntax:
for var1 in seq1:
for var2 in seq2:
statements.
❖ While in while
Syntax:
while condition1:
while condition2:
Statements.
❖ For in while
Syntax:
while condition1:
for var1 seq1:
Statements.
❖ While in for
Syntax:
for variable1 in seq1:
while condition1:
Statements.
Arrays in Python
• Array is a container that hold multiple values of the same datatype.
• Syntax:
Variable = Array(type code,[elements]
Functions in Python
• A function is a set of code that performs some task.
• Syntax:
def function_name():
Statements
• When function is called the function returns a value to the calling function.
Objects and Classes in Python
• Just like everything in the real world is an object, so is the case with Object Oriented
Programming paradigm.
• A class is a blueprint for similar objects.
• OOPs( Object Oriented Programming ) is a programming paradigm that focuses on an
object.
• Every instances in python is an object.
• An object has:
❖ Attributes: data describing the object.
❖ Behavior: methods on the attributes.
• A class is a collection of similar objects.

Threading in Python
• Threading allows you to have different parts of your process run concurrently.
• A thread has its flow of execution, which means that the process will have multiple things
happening at one time.
• It is important to note that each process has at least one thread, and that is called the main
thread.
If your program doesn’t have any defined thread, then it will at least have the main, i.e.,
the process tiself.
Turtle library in Python
• Turtle is a Python library which used to create graphics, pictures and games. It was
developed by Wally Feurzelg, Seymour Parpet and Cynthina Slolomon in 1967. It was
the part of the original Logo programming language.
• The turtle is built in library so we don’t need to install separately. We just need to import
the library into our Python environment.
• The python turtle library consists of all important methods and functions that we need to
create our designs and images. Import the Turtle library using the following command.
import turtle

Method Parameter Description

Turtle() None Creates and returns a new turtle object


forward() amount Moves the turtle forward by the specified
amount
backward() amount Moves the turtle backward by the specified
amount
right() Angle Turns the turtle clockwise
left() Angle Turns the turtle counterclockwise
penup() none Picks up the turtle’s pen
pendown() none Put down the turtles pen
up() none Picks up the turtle’s Pen
down() none Puts down the turtle’s pen
color() Color name Changes the color of the turtle’s pen
fillcolor() Color name Changes the color of the turtle will use to
fill a polygon
heading() none Returns the current heading
position() none Returns the current position
goto() x,y Move the turtle in position x, y
begin_fill() None Remember the starting point for a filled
polygon
end_fill() None Close the polygon and fill with current fill
color
dot() None Leave the dot at the current position
stamp() None Leaves an impression of a turtle shape at
the current location
shape() Shape name Should be ‘arrow’, ‘classic’, ‘turtle’, or
‘circle'
Conclusion and Scope of further work

Throughout this project work, the high level language Python has been learnt and utilized in
developing a simple game on computer. Thus, like this many other games and other applications
or software can be developed using this language that may help to solve many real life problems.
For example, we may apply software to create mechatronics devices which combines the
mechanical movements and electronic circuits to create a electronically controlled mechanical
device.
BIBLIOGRAPHY

➢ Skillup from simplilearn


➢ Greatlearning
➢ Wikipedia
➢ Youtube channels:
• Keith Galli
• Freecodecamp.org
• pyGuru
➢ www.ponggame.org
➢ www.geeksforgeeks.org
➢ www.edureka.co

You might also like