But Can I Make Pong?

I’ve been reading quite a few articles on game development – something I hope to do eventually – and came across one article titled “But Can You Make Pong?” After making a handful of 1% finished project, I decided to create Pong and actually finish it. So far, it’s going well.

To create Pong, I chose the LÖVE 2D game engine. I used the very scientific method of googling “open source 2d game engine” and it looked easy enough to use. It uses the Lua language, which is also new to me but seems to be a popular one for games and there’s certainly no harm in knowing more programming languages.

This past weekend I actually started it, and made a decent dent in its progress. So far I have a start screen, the main game screen, and the game over screen. The game itself consists of the player -controlled by the up and down arrow keys – and the ball that starts in the middle and shoots off in a random direction, bouncing off the top and bottom walls as well as the wall opposite the player.

Much of my time was spent on collision detection, and making sure it occurred at the correct place. Reflecting the ball off of walls was surprisingly easy – I used two variables to track the velocity, dX and dY. When it hit, say, the top wall, its dY gets multiplied by -1 and it continues on its way.

Next up is to improve the title screen, add a timer to use for scoring and make the ball speed up over time. Maybe for added difficulty I could make the ball go from larger to smaller as well.

pong_01-28-13

Pong as of 1/28/13

Advertisement
Privacy Settings

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: