The purpose of this project is to present a classic game, Pong, in a new and innovative way by building a three-dimensional projection of four-dimensional Pong using VPython. Briefly, for anyone who may not know, Pong is a two-dimensional game that involves two paddles virtually bouncing a ball back and forth until one of the paddles misses.
Here are pictures of the 3D game I created using VPython
The controls of the game utilize the universal WASD setup with a few additions. W moves the paddle up, S moves the paddle down, D moves the paddle right, A moves the paddle left. The additions I made are as follows: Q moves the paddle into the screen, E moves the paddle out of the screen, and Escape (esc) stops the program.
I created the walls and paddles using Vpython's built in box object. Once those were in, I worked to make a bouncing ball withing a 3D figure (my VPythonBallInCage project, see my projects page). Once I had that down, I began to work to implement user controls. This proved a little difficult as VPython isn't meant for games. Finally, I made the game's AI (artificial intelligence aka what makes the opposing paddle move) and added a few bug fixes and small features. With that, my game was mostly complete.
To improve my program and make it more fun, I had a few improvements I'd like to implement in the future. Firstly, I'd like to make a nice, playable 4D (3D projection of 4D) stage. I have one complete, but it is not as nice as it should have been. Therefore, I decided I'd chalk that up for a later release. The idea was to create a 3D representation of a hypercube and use that to make the game itself more interesting (i.e. different places where the ball could rebound).
Another thing I would like to implement, is a more randomized initial velocity. For now, I left it as a set vector because when it became random, it created problems for the AI. The AI would be either unable to get to the ball, or would be unable to lose. There was very rarely a middle ground.
This brings me to my next improvement, a better AI. From research, I found that a lot of basic Pong AIs just move in the direction of the ball's coordinates at a set speed. This is the method I decided to utilize, but it has it's problems. Since the paddle's velocity is hard set in the code, it makes varying the ball's velocity rather difficult. Because of this, I'd like to implement an AI that is more dependent on the ball's velocity and allows variations to occur with said velocity. I have ideas as to how I will implement it, but further details will come at a later date.