Ping Pong Game using VGA Output

Ping Pong Game using VGA Output (Monitor) and Microcontroller
BY
Al Imran
ID: 151-15-5373
&
Md.SabbirHossain
ID: 151-15-5318
&
Mostofa Jamal Uddin
ID: 151-15-5288
This Report Presented in Partial Fulfillment of the Requirements for the Degree of Bachelor of Science in Computer Science and Engineering.

Supervised By
Mr. Md. RakibHasan
Lecturer
Department of CSE
Daffodil International University
2291080107315
DAFFODIL INTERNATIONALUNIVERSITY
DHAKA, BANGLADE
ACKNOWLEDGEMENT
First we express our heartiest thanks and gratefulness to almighty Allah for His divine blessing makes us possible to complete this project successfully.

We fell grateful to and wish our profound our indebtedness to Mr. Md. RakibHasan, Lecturer, Department of CSE, Daffodil International University, Dhaka. Deep Knowledge &keen interest of our supervisor in the field of Ping Pong Game using VGA Output (Monitor) and Microcontroller us to carry out thisproject .His endless patience ,scholarly guidance ,continual encouragement,constant and energetic supervision, constructive criticism , valuable advice,reading many inferior draft and correcting them at all stage have made it possible to complete this project.

We would like to express our heartiest gratitude to Dr. Syed AkhterHossain, Professor and Head, Department of CSE, CIS & CS for his kind help to finish our project and also to other faculty member and the staff of CSE, CIS & CS department of Daffodil International University.

We would like to thank our entire course mate in Daffodil International University, who took part in this discuss while completing the course work
Finally, we must acknowledge with due respect the constant support and patients of our parents.

ABSTRACT
Games are played by all kinds of people all over the world. Mobile phones and internet now allow portability in gaming experience. E-sport are also getting popular day by day. As well as people all over the world like to play games. So gaming industry has a strong market including developing countries.Actually our game is a hardware base game, by which we can able to generate more knowledge in interfacing field and also programming. Here we use Arduino microcontroller and a programming language that is “C” If we think why this type of game then many answer is available for this question one of them is cost, that is most important fact. We can able to play a game where no needany as usual system unit, only our device is enough to play. So that is the main fact in this game here two players will be play where two bat and one ball will be available as like table tennis. Initially the ball position will be select randomly suppose at first the ball will go to the player-1, the player-2 will hit the ball by his bat and ball will go to the player-1 side. If player-1 is also hit the ball then it will come to player-2 again and an upper boundary and lower boundary will be available in this game if the ball will go to player 1 and if he/she miss to hit the ball and ball touch the boundary of player-1 side then player-2 will get a point as like when player-2 will miss then player-1 will earn a point. Player-1 and player- 2 its movement will be control by a potentiometer that voltage will be 0-5 volt .when voltage will be low then the bat will move to high but it’s value increase then the bat will go to lower side of window. when the point will be increase speed of the game will be increase. And a dedicated score will be fix in this game who will earn that point firstly he/she will win .

TABLE OF CONTENTS
Contents page

Board of Examiners iv
Declaration v
Acknowledgements ii
Abstractvi
Table of Content vii
List of Figures xi
CHAPTERS
CHAPTER 1: INTRODUCTION
1.1 Overview1
1.2 History
1.3 Reasons of Selecting this Project5
1.4 Virtual Satisfaction
1.5 Benefits of this Project
CHAPTER 2: BACKGROUND STUDY
2.1 Literature Review:
2.2 Significance of Study
2.3 Project Planning
2.4 Project Management
2.5 Summary
CHAPTER 3: Experimental Details
3.1 Methodology
3.1.1Used Tools
3.1.2Used Algorithm and Techniques
3.2 Analysis
3.2.1How to Create Game Environment ?
3.2.2How to interface between player and objects
3.2.3 How to adjust the screen frequency(horizontal and vertical)
3.2.4 How to play?
4.1 Introduction
4.2 Collecting Apparatus
4.2.1 To implement fundamentals
4.3 Creating Ping Pong game window
4.4 Creating Players bats
4.5 Creating Ball
4.6 Score Generation
CHAPTER -5:
5.1 Future Work
5.2 Conclusion
5.4 References
LIST OF FIGURES

Introduction
1.1 Overview
Ping Pong game is a popular classical game in the 60’s or 70’s and it is easy to play. Now we have very advanced and sophisticated video games. As an experiment and for the purpose of acquiring knowledge of peripheral interfacing.we decided to make this classic game from the scratch using minimum hardware and with help of no modern operating system and to have an experience how it was like to build a game back in the day.

It is a color version of Ping Pong game to be played in our VGA monitor, programmed in a bare ArduinoUno.This game is a 2D game and only written in C.The target is to use an Arduino Uno without any shields extra ICs. There are two joysticks like controllers made using two potentiometers. The graphics can be displayed on any monitor using standard VGA cable.The gameplay includes only two players and simple scoring systems.No operating system, no complex graphics utilized. It is just a simple interface between a game controller and VGA monitor facilitated by the Arduino Uno.

1.2 History
Here we will see the history of Arduino, Actually it is an open source computer hardware and software firm, project, and user community who designs and manufactures single-board microcontrollers ,microcontrollerdecoration for building, digital instruments and interactive objects that can sense to control objects in the physical world.

In this section we will know who is the founder of Arduino? Massimo Banzi is the co-founder of the Arduino project. He is an Interaction Designer,Educator and Open Source Hardware advocate. He has worked as a consultant for clients such as: Prada, Artemide, Persol, Whirlpool, V;A Museum and Adidas.

Now we want to observe Arduino project was invented Massimo Banzi tried to invent the Arduino, a tiny,easy-to-use open-source microcontroller that’s inspired thousands of people around the world to make the coolest things they can imagine — from toys to satellite
gear. Because, as he says, “We don’t need anyone’s permission to make something great.”
In fact the programming language of Arduino such as the Arduino language is merely a set of C/C++ functions that can be called from our code.

Our sketch undergoes minor changes (e.g. automatic generation of function prototypes) and then is passed directly to a C/C++ compiler.

History aboutPing pong
EARLY ORIGINS OF PING-PONG
In 12th Century the game of table tennis probably descended from the the game of “Royal Tennis” (also known as Real Tennis or Court Tennis),which was played in the medieval era.

1880’s – Some sources claim that the game was once known as indoor tennis,
1890’s – By this time,various patents with basic rules had been registered.

1903 – On the 1st May 1903, “The Table Tennis Association” and “The Ping Pong Association” amalgamateforming “The United Table Tennis and Ping Pong Association”. This association will later revert its name to “The Table Tennis Association”,
before becoming vanished in 1904.

1920’S – 1950’S – CLASSIC HARD BAT ERA – EUROPE DOMINATES THE SPORT
1920’s – In the early 1920’s the game began to revive in England and Europe.

1922 – “The Table Tennis Association” is reconstituted, with the name “English Table Tennis Association” being adopted in 1927.

1930-1935 – Victor Barna of Hungary wins five of the six Men’s Singles events at the World Championships (and was runner up in 1931).

1940-1946 – No World Championships held due to World War II.

1950-1955 Angelica Rozeanu-Adelstein of Romania wins six Women’s Singles titles in a row at the World Championships.
1950’S – 1970’S – SPONGE BAT ERA, RISE OF JAPAN AND CHINA
1959-1960 – The ITTF standardizes the thickness of ordinary pimpled rubber and sponge rubber.

1960’s – In the early 1960’s, the loop drive was invented and become popular around the world.

1971 – The first Commonwealth Championships are held in Singapore.

1970’S – 2000’S – THE AGE OF SPEED GLUE & TECHNOLOGY
1980 – The first World Cup event is held in Hong Kong.

1982 – The initial World Veteran’s Championships is conducted in Gothenburg, Sweden.

1997 – Jan-OveWaldner wins the Mens Singles title at the World Championships for the second time,
this time without the loss of a single game!
2000 – The ITTF increases the ball diameter to 40mm.

2001 – The ITTF changes the scoring system, moving to 11 point games, and using a best of 5 games or best of 7 games match.

2002 – Table Tennis becomes a Commonwealth Games Sport, at Manchester, England.

2008 – The use of speed glues with illegal VOCs is banned for all ITTF junior competitions as of January 1.

1.3 Reasons of Selecting this Project
1.4 Virtual Satisfaction
1.5 Benefits of this Project
There are a handful of reasons why playing ‘ping pong’ is good for your brain. This article lists the mental benefits of table tennis game for the young and old.

TABLE TENNIS BRAIN HEALTH: Ping-Pong is not a difficult sport to learn or to play. But it brings a heap of mental health benefits to the table.

Research suggests it can improve memory retention and attention span in seniors. It has benefits for motor learning and helps to enhance or boost moods.

Scientists continue to explore exactly how physical exercise affects the human brain.

But, they seem confident that attention increases and memory increases exponentially with movement.

At the same time as mood improves you also build motor circuits inside your brain. That means a bigger part of the human brain gets activated – more than usual.

There is no denying that pong a popular sport. The International Table Tennis Federation is the sport’s governing body. They say more than 300 million people play table tennis rules worldwide.

Even so, many will prefer to get their walking exercise benefits from a brisk stroll or from jogging. There are other recreational paths that also provide the mental perks of exercising. The choice for many is a full aerobic workout from one of the outdoor sports list of activities.

Table tennis is a game with strategy. Some say it is like playing chess rules with a certain ‘mojo’ at the highest

2.1 Literature Review:
Here we will see the background study of our project. According of our varsity syllabus we completed many subject from that some subject is make interested to us for choosing this project as like we completed microcontroller and assembly language where we knew about microcontroller that, A microcontroller is a small computer on a single integrated circuit.

the microcontroller contains one or more CPUs with memory and programmable input/output peripherals . Microcontrollers are designed for embedded applications, in contradict to the microprocessors used in our personal computers and other general purpose applications consisting of different discrete chips. Microcontrollers are used in automatically controlled products and devices, as like automobile engine control systems, remote controls, office machines, appliances, power tools, toys and also other embedded systems. By reducing the size and cost compared to a design that uses a separate microprocessor, memory, and input/output devices, microcontrollers make it economical to digitally control even more devices and processes. Mixed-signal microcontrollers are common, integrating analogue components needed to maintain non-digital electronic systems.2.2 Significance of Study
After gathering knowledge about this all types of technical part we understood that if we able to do something that practical it will be better for our knowledge so we started to find something that helps us for this purpose and we got the decision that peripheral and interfacing related work it will be more help full for our plan and after finding so ma resources we decided that we will dos something about arguing microcontroller because it is
2.3 Project Planning
2.4 Project Management
2.5 Summary

Experimental Details
3.1 Methodology
3.1.1 Apparatus
Here we will see some electronics devices that uses in this project
3.1.2
3.1.3
3.2 Analysis
3.2.1How Create Game Environment
Everything has an own status and also in game that means every game has an own environment that represent its characters similarly our game has an own environment and some materials of this game is a fixed boundary as like rectangle every stapes or every parts of this game will performs in this area where is also available a ball that will move from horizontal to vertical and also left to right or right to left side the goal of this ball will be touch any one boundary from left or right. Here will be to bat that move vertically up and down who try to protect left or right wall from the ball. For both player a counter will be available who genarate the point of every player and every player will be notify by a dedicated name
3.2.2
3.2.3
3.2.4 How to play?

Implementation
4.1 Introduction
here two players will be play where two bat and one ball will be available as like table tennis. Initially the ball position will be select randomly suppose at first the ball will go to the player-1, the player-2 will hit the ball by his bat and ball will go to the player-1 side. If player-1 is also hit the ball then it will come to player-2 again and an upper boundary and lower boundary will be available in this game if the ball will go to player 1 and if he/she miss to hit the ball and ball touch the boundary of player-1 side then player-2 will get a point as like when player-2 will miss then player-1 will earn a point. Player-1 and player- 2 its movement will be control by a potentiometer that voltage will be 0-5 volt .when voltage will be low then the bat will move to high but it’s value increase then the bat will go to lower side of window. when the point will be increase speed of the game will be increase. And a dedicated score will be fix in this game who will earn that point firstly he/she will win .

4.2 Apparatus
4.3 Create Ping Pong Table
4.4 Create Player
4.5 Create Ball
4.6 Score Generate

5.1 Future Work
5.2 Conclusion
5.3 Appendices
5.4 References