CONCEPT

Why?

I have always liked playing pinball games, even when they started getting pricey. Microsoft incorporated a pinball game with the release of its NT operating system called Space Cadet. I program on an NT station at work and play the game frequently. After getting a bit bored with it, I wondered if there were any games to allow someone to create their own pinball games. I purchased some software, but it did not allow the freedom I was looking for. Others I found out from various bulletin boards were also dismayed at what the market had to offer. Failing to find an excellent pinball applet in web searches, there was only one thing to do... write my own.

What?

When writing my applet, I had 3 options: Produce a closed game, create Java classes to allow other Java developers to create their own closed games, or develop an applet that allowed most anyone to design their own game. I of course went with number 3 so I could share the applet and see what others could create.

How?

You do not have to know Java to make your own pinball game from this applet. All that is needed is a bit of knowledge about html coding and some knowledge of graphics editing. You see, the whole game is controlled by images. More of this is in the tutorial, but here is a quick version of the system. The applet loads several images(all customized) that includes 3 major images. The first one is what you actually see. The other 2 are 'keys' for the ball that are unseen in the game. One for the main level and one for the ramps. These 'key' images control the movement of the ball with the colors of its pixels. As the ball moves around, the game monitors 12 points around it. If any of those pixels encounters say black, that is a wall, or red, which is a bumper. The ball then takes appropriate action in the appropriate direction.

Who?

To give you a background of who I am, and how I could accomplish this let me give you my credentials. I have a degree in Physics. Boy did that come in handy! I pulled out my old book from PhysicsI on simple mechanics. The game incorporates symmetric reflection off of walls, constant gravity, friction loss, loss of energy due to a collision, etc. To make things difficult in programming the y-axis is reversed so that the point (0,0) is in the upper left corner. This leads to the rewriting of some angle formulas. Luckily I could also use my second degree, Mathematics. The math behind the game is probably over complicated, but it works. To give you an example of some hard thinking math, when the ball is struck by a paddle several things have to be considered. At what angle is the paddle when it strikes the ball? What is the new vector of the ball after reflecting off the paddle? But the paddle is giving the ball energy perpendicular to its surface, what is the ball's new vector when this is added in? You get the point. I have no degree in programming, but have been doing so since 5th grade. A special thank you to my beta tester John E. Howard!

When?

I started writing the applet sometime in May of 2000 after taking a class in it at work. It took me a little over a year to churn something out. This is because I have been rather busy with my twins born about the same time I started writing the game. They keep me pretty busy. The code could be a lot more efficient and should be rewritten. I can see a lot of mistakes I made near the beginning of the project when I was still new to Java and Object Orientated Programming. The game continues to get better, though!


back