You are on page 1of 21

Mini project Report on

Built a Ping Pong Game using C#


Is submitted in partial fulfilment of the requirement of the
S.E. (Computer Engineering)

By

Shubham Bane (SE A/Roll no.3)


Tejas Indulkar (SE A/Roll no.27)
Yash Desai (SE A/Roll no.12)

Under the guidance of

Prof. Shweta Patil

Department of Computer Engineering


Shivajirao S. Jondhale College of Engineering,
Dombivli(E)
(2020-21)
Samarth Samaj’s
SHIVAJIRAO JONDHALE COLLEGE OF ENGINEERING
DOMBIVLI(E)

CERTIFICATE
This is to certify that the following students have submitted the project report
On “Built a Ping Pong Game using C#” is a bonafide work of Shubham Bane,
Tejas Indulkar, Yash Desai submitted to the University of Mumbai in partial
fulfilment of the requirement for the requirement for the award of the degree of
“Bachelor of Engineering” in “Computer Engineering” .

Shubham Bane(SE A)
Tejas Indulkar(SE A)
Yash Desai(SE A)

Prof.Shweta Patil
Project Guide

Prof. Uttara Gogte Prof.P.R.Rodge


Project Coordinator Head of
Department

Dr.J.W.Bakal
Principal
Mini Project Approval

This Mini Project entitled “Built a Ping Pong Game using C#” by Shubham
Bane,Tejas Indulkar, Yash Desai is approved for the degree of Bachelor of
Engineering in Computer Engineering.

Examiners

1__________________
(internal Examiner Name & Sign)

2___________________
(External Examiner Name & Sign)

Date:

Place:
Table of Contents
Title Pg. no.

Abstract i
1. INTRODUCTION1 1
1.1 Introduction
1.2 Motivation
1.3 Problem Statement &Objectives
2. LITERATURE SURVEY 3
2.1Survey of Existing System
2.2 Advantage of C# over JAVA
2.3 PING PONG Game

3. PROPOSED SYSTEM 6
3.1 Introduction
3.2 .net Framework / Architecture
3.3 Algorithm and Process Design
3.4 Details of Hardware & Software
3.5 Results
3.6 Conclusion
3.7 Applications
REFERENCE 15

Acknowledgment 16

Abstract
 Computer gaming is a key component of the rapidly growing entertainment industry.
While building computer games has typically been a commercial endeavour, we
believe that designing and constructing a computer game is also a useful activity for
educating students about geometric modelling and computer graphics.

 In particular, students are exposed to the practical issues surrounding topics such as
geometric modelling, rendering, collision detection, character animation and graphical
design. Moreover, building an advanced game provides students exposure to the real-
world side of software engineering that they are typically shielded from in the
standard computer class.

 Typically, the games that we create in the class are 2D game, collision detection is
very important for defining how players interact with the game. Our games require
collision information for a variety of primitives.

 C# (C-Sharp) is a programming language developed by Microsoft that runs on the


.NET Framework. C# is used to develop web apps, desktop apps, mobile apps, games
and much more.

1.INTRODUCTION
1.1INDRODUCTION

Making games is a creative and technical art form. Developing videogames using the
industry standard game development tools, including the Visual Studios 2019 engine
and C#.
Video game development is the process of developing a video game. The effort is
undertaken by a developer, ranging from a single person to an international team
dispersed across the globe. Development of traditional commercial PC and console
games is normally funded by a publisher, and can take several years to reach
completion.
Games are developed as a creative outlet and to generate profit. Game making is
considered both art and science. Development is normally funded by a publisher.
Well-made games bring profit more readily.
The first computer games appeared in the fifties of the 20th century - since then, their
development has proceeded at a vertiginous speed. It was almost impossible to
assume that they will become one of the dominant social phenomena, and that, in the
last decade of the 20th century, the industry of computer games generates more
revenue from the film industry.
The popularity of computer games led to thinking about their application in education.
Games became an integral part of modern society. They are the ideal platform for
presenting new content and new technology - a lot of people play computer games
and accept them as a normal form of entertainment. Research shows that not only
youth who play games - big part of the playing population are adults [1]. According to
the report of the American Association for entertainment software (ESA -
Entertainment Software Association) in 2006.
Electronic games are a new mass medium, with its characteristics, as compared to the
now traditional media such as books, television, film or music. In contrast to all
existing media, games have the opportunity to interact, allowing the user to actively
participate, not just passively receive information. That is why the last few years we
can see more and more use of computer games for education. Educational games are
social, card, or computer games that are specifically designed to teach people about a
certain subject, expand concepts, reinforce development, understand an historical
event or culture, or assist in the development of certain skills.

1.2MOTIVATION
Our group is highly enthusiastic. We love playing games in our chill time as other
college boy. So why not we develop our own game? That question gave us an idea to do
this project. And for developing game we choose C# language. As it is a new language,
and knowing its increasing popularity in programming sector, and to enhance future
scope we decided to choose C#. The next challenge was to select appropriate game.
We don’t want to develop too simple game i.e. Snake, etc. and of course not to hard
which let us decades to complete.
The game Ping Pong suited our requirement, it was our ideal choice, it requires to handle
collision between ball, racket and wall.
We love app development and hope so we continue doing same.

1.3PROBLEM STATEMENT & OBJECTIVES

 Lack of face-to-face communication because of COVID-19.

 Time constraints, all thanks to COVID-19.

 Faced some problem while started learning C#. But eventually it went quite easy.

The objective of the project is to build an application which is:


 Efficient
 Reliable
 Easy to use
 Cost effective
 Less time consuming

2.LITERATURE SURVEY
The project focuses on educational computer games. They combine education and
entertainment in a concept known as edutainment. This concept usually assumes that users
provide lessons in a fun environment recognizable: television, computer games, movies,
music, websites, multimedia software and so on. It is known that computer simulation has
long been used to train civilian and military pilots.
Modern flight simulation games are so highly developed that greatly surpassed the
commercial software, especially in the quality of sound, graphics, and the degree of realism
in general. In Germany is already working on a program very similar to computer games that
simulate driving a car in the city and on the open roads. The advantage of these flights and
car-simulation is that they represent a cheap way to simulate incidents and enhance response
by participants. Disadvantage is that in comparison to modern computer games they
reminiscent to clumsy attempts at 2D animation of the twentieth century. There are
indications that even a shooting game in first person in some areas can be used as an
educational tool.
Some armies take them to be cost-effective way to supplement tactical knowledge of military
and anti-terrorist unit, as well as orientation and coordination skills. Many social and
computer games that are not intended to be strictly educational in themselves carry a
significant educational aspect. Monopoly teaches us basic principles of market economy,
Microsoft's Age of Empires series, Total War games, and Civilization teach political
economy, history, military theory, and even sociology and ecology.
There are also many games that teach management: Transport Tycoon (management of urban
and intercity transport), Railroad Tycoon (managing railway), Rollercoaster Tycoon
(managing amusement park), Sim City I-IV (management of the modern city), Football
Manager (managing a football club) and many others. It is significant to mention the
educational games for kids. Sales of classic toys shown a downward trend from year to year,
and the kids all spend more time next to the screen.
Thus, this genre of computer games is becoming extremely important. Children's educational
games are educational in the true sense of the word. There are games for all ages, from those
that resemble picture books in electronic format, to games like The Sims to help teenagers to
cope with and resolve problems in the real world.

2.1Survey of Existing System


The focus of higher education institutions is the preparation of future professionals. To
achieve this aim, innovative teaching methods are often deployed, including games and
simulations, which form the subject of this paper. As the field of digital games and
simulations is ever maturing, this paper attempts to systematically review the literature
relevant to games and simulation pedagogy in higher education. Two researchers collaborate
to apply a qualitative method, coding and synthesizing the results using multiple criteria. The
main objective is to study the impact of games and simulations with regard to achieving
specific learning objectives. On balance, results indicate that games and/or simulations have a
positive impact on learning goals. The researchers identify three learning outcomes when
integrating games into the learning process: cognitive, behavioural, and affective. As a final
step, the authors consolidate evidence for the benefit of academics and practitioners in higher
education interested in the efficient use of games and simulations for pedagogical purposes.
Such evidence also provides potential options and pathways for future research.

2.2Advantages of C# over JAVA

 C# being a .NET language, supports language interoperability, i.e. C# can access code
written in any .NET compliant language and can also inherit the classes written in
these languages. This is not possible in Java.

 The code written in C#, on compilation generates an ‘.exe' or ‘.dll' file which is also
called Portable Executable file. These files contain MSIL (Microsoft Intermediate
Language) code. As against this, the Java code on compilation generates a ‘.class' file,
which contains bytecode. 
 The portable executable file of C# can contain any number of classes, whereas, the
‘.class' file in Java contains only one class.
 The methods in C# are not virtual by default. On the contrary, methods in Java are
virtual by default, which degrades the performance.
 The classes in C# are grouped in Namespaces, whereas, classes in Java are grouped in
Packages.
 The C# namespaces are not related to the directories. The packages in Java are
directly related with the directory names.
 The variables of primitive data types in C# are more powerful. This is because even
though they are not objecting functions can be called using them. The variables of
primitive data types in Java cannot call functions.
4
 C# has features like Properties and Indexers. These features are not available in the
Java language.
 C# supports Structures, Operator Overloading and Pre-processors directives, whereas,
Java has none of them.
 Through C# we can easily call Windows API function and access COM components
which is quite difficult in Java.

2.3Ping Pong Game

Ping Pong game works on the mechanism of Table tennis but it is an e-game. It is a single
player game; the ball is bounced over boundaries and a racket is used to bounce back the ball.
Racket is controlled by mouse. Score shows number of times you saved ball from hitting
below. Boundary shows boundary of window.

3.PROPOSED SYSTEM
3.1INDRODUCTION

According to Stack Overflow survey, C# is still one of the Top 10 most popular (#4) and
most loved programming languages.
It has been 19 years since Microsoft publicly announced C# language in 2000. Over the
years, C# language has matured and has become one of the most popular and loved
programming languages among Microsoft developers. As a matter of fact, C# language is #4
among the most popular programming languages behind Java, C, and C++.
Today, C# is not only a Windows development programming language but can be used to
build Web applications, Windows store apps, and mobile apps including iOS and Android.
C# can also do more than that.

Microsoft’s Dustin Campbell and Mads Torgersen talk about the future of C#.
• You can write C# in any editor you want
• C# is open source now
• C# runs on Windows, Mac, and Linux
• C# can be used to build Windows client apps, Windows Store apps, iOS apps, and
Android aps and can also be used to build backend and middle-tier frameworks and
libraries.

3.2 .NET FRAMEWORK / ARCHITECTURE


.NET is a developer platform made up of tools, programming languages, and libraries for
building many different types of applications.

There are various implementations of .NET. Each implementation allows .NET code to
execute in different places—Linux, macOS, Windows, iOS, Android, and many more.

.NET Framework is the original implementation of .NET. It supports running websites,


services, desktop apps, and more on Windows.
.NET Core is a cross-platform implementation for running websites, services, and console
apps on Windows, Linux, and macOS. .NET Core is open source on GitHub.
Xamarin/Mono is a .NET implementation for running apps on all the major mobile operating
systems, including iOS and Android.
.NET Standard is a formal specification of the APIs that are common across .NET
implementations. This allows the same code and libraries to run on different
implementations.

Architecture of .NET Framework


The two major components of .NET Framework are the Common Language Runtime and
the .NET Framework Class Library.
The Common Language Runtime (CLR) is the execution engine that handles running
applications. It provides services like thread management, garbage collection, type-safety,
exception handling, and more.
The Class Library provides a set of APIs and types for common functionality. It provides
types for strings, dates, numbers, etc. The Class Library includes APIs for reading and
writing files, connecting to databases, drawing, and more.

3.3Algorithm & Process Design


Algorithm:

Topics used in project:

 C# Variables & Operators

A variable is a name given to a storage area that is used to store values of


various data types. Each variable in C# needs to have a specific type, which
determines the size and layout of the variable's memory.

For example, a variable can be of the type String, which means that it will be
used to store a string value. Based on the data type, specific operations can
be carried out on the variable.

 Properties

Properties are named members of classes, structures, and interfaces. Member variables or
methods in a class or structures are called Fields. Properties are an extension of fields and
are accessed using the same syntax. They use accessors through which the values of the
private fields can be read, written or manipulated.
Properties do not name the storage locations. Instead, they have accessors that read,
write, or compute their values.

 Lable
In Windows Forms, Label control is used to display text on the form and it does not take
part in user input or in mouse or keyboard events. The Label is a class and it is defined
under System.Windows.Forms namespace.

 Events

Events are user actions such as key press, clicks, mouse movements, etc., or some
occurrence such as system generated notifications. Applications need to respond to events
when they occur. For example, interrupts. Events are used for inter-process
communication.
The events are declared and raised in a class and associated with the event handlers
using delegates within the same class or some other class. The class containing the event
is used to publish the event. This is called the publisher class. Some other class that
accepts this event is called the subscriber class. Events use the publisher-subscriber
model.

 Stub

Stub types are one of two technologies that the Microsoft Fakes framework provides to let
you easily isolate a component you are testing from other components that it calls. A stub
is a small piece of code that takes the place of another component during testing.

Process Design:
I. We started learning C#

II. Covered all topics needed for app development.

III. At first, we prepared small project E.g., Simple calculator, Drawing Board.

IV. Learned collision handing Techniques.

V. Modify game for better exerience.

VI. Applied RGB background effect.

VII. And our game finally got ready.

10

3.4Details of Hardware & Software


 Processor: 1.8 GHz or faster processor. Quad-core or better recommended
 RAM: 8 GB of RAM recommended (2.5 GB minimum if running on a virtual
machine)
 Hard disk space: Minimum of 800MB up to 210 GB of available space.

Software requirement

 Operating System: Windows XP & above


 Coding Language: C#

Software Used

 Visual Studio 2019

11

3.5RESULTS
Expected Results:

 During game:

12

 When game ends:


13

3.6CONSLUSION
We presented the Project on Ping pong game. Thinking of the game as a part of a bigger
educational process is really in the core mind-set that this project wants to promote. Games
can do many things very well, but they certainly cannot do everything at once. Especially not
without solid supporting structures around them. Throughout the project and the case studies
we built this was true. As each teacher build her or his story these processes were discussed
and reflected upon and we will be referring to these and link back to them.

This project aimed as much at using alternative and innovative methods to teach through
coding digital games and playing games as part of learning, as at developing the skills of
teachers in extending academic goals to understand, support and include the whole child: not
only their academic subject skills but also social, emotional and behavioural skills.

3.7APPLICATION

Possible application of summarization are as follows. Can be used in:

 Refreshes our mind


 Easy to play
 Improves concentration

14

REFERENCE

1. C# in depth (3rd edition) Jon Skeet FOREWORD BY ERIC LIPPERT


2. Learn C# in One Day and Learn It Well: C# for Beginners with Hands-On Project

3. CLR via C#, 4th Edition

4. C# 7.0 in a Nutshell: The Definitive Reference

5. Wikipedia: https://www.wikipedia.org/

6. Geeks for Geeks: https://www.geeksforgeeks.org/

7. Stack Over Flow: https://stackoverflow.com/

8. Tutorial Point: https://www.tutorialspoint.com/index.htm

15

ACKNOWLEDGEMENT
We would like to thank our college principal Dr. J.W. Bakal for providing lab
facilities and permitting us to go on with our project.

We also express our deepest thanks to our H.O.D. Prof. P.R. Rodge whose
benevolent helps us making available the computer facilities to us for our project in
our laboratory and making it true success. Without his kind and keen co-operation
our project would have been stifled to standstill.

We would like to thank our project coordinator Prof. Uttara Gogate for all the
support we need from her for our project.

Lastly, we sincerely wish to thank our project guide Prof. Shweta Patil. for her
encouraging and inspiring guidance helped us to make our project a success. Our
project guide makes us endure with her expert guidance, kind advice and timely
motivation which helped us to determine about our project. We would also like to
thank our colleagues who helped us directly or indirectly during our project.

16

You might also like