Introduction

Pong is one of the earliest arcade video games and a two-dimensional sports game which simulates table tennis and was the first game developed by Atari Inc in June 1972. The player controls an in-game paddle by moving it vertically across the left side of the screen, and can compete against either a computer controlled opponent or another player controlling a second paddle on the opposing side. Players use the paddles to hit a ball back and forth. The aim is for a player to earn more points than the opponent; points are earned when one fails to return the ball to the other.

Pong is a simple game to code. The game involves a ball and two pads. The ball moves around on its own in the game world, and the player moves the pad. If the ball hits the wall or lands on the pad, change the ball's general direction. But if the ball misses the pad, then display the message - you missed - to the player.

The controls are:

UP

move pad up

DOWN

move pad down

TAB

toggle Cheat on/off

F1

display help

Writing code for the core logic of a Pong game is as follows. First update the position of the pong ball:

Share

About the Author

About me:
I attended programming college and I have a degree in three most famous and successful programming languages. C/C++, Visual Basic and Java. So i know i can code. And there is a diploma hanging on my wall to prove it.
.
I am a professional, I am paid tons of cash to teach or do software development. I am roughly 30 years old .

I hold lectures in programming. I have also coached students in C++, Java and Visual basic.

In my spare time i do enjoy developing computer games, and i am developing a rather simple flight simulator game
in the c++ programming language using the openGL graphics libray.

I've written hundreds of thousands of code syntax lines for small simple applications and games.

I have often wanted to delve into some console programming, but find the lack of resources disappointing. Then I look at this and think "Hey, this is cool - especially for a console app!" Then I start to read and suddenly I'm finished reading and once again disappointed.
There has to be some theory, approach, design, tools and the like that would help some of us (okay, if no one else, then ME!) learn a little about all this... right? Oh well, this is worth a 4 at least, good effort code wise, just lacking on the article is all... Keep at it though!