Pong
Initial Started | February 23, 2012 |
Latest Release | December 08, 2012 |
Language | C++ |
Audio | FMOD |
GUI | MyGui |
Input | OIS |
Rendering | OGRE3D |
Microsoft Windows | |
Version 0.0.4 | December 08, 2012 |
Game | Pong-dev-v0.0.4-vc11.zip |
The game is compiled with Microsoft Visual Studio 2012. Please install the Microsoft Visual C++ 2012 Redistributable Package if your Windows doesn't has the package installed.
Easy configuration:
Choose the OpenGL Rendering Subsystem and click on Accept. This will use the default configurations, such as starting the game in fullscreen mode and use the highest available screen resolution.
To display the "Setup Dialog" again, just delete the ogre.cfg. The settings are stored in the file.
The collision detection algorithm is based on the lecture from the course "Advanced Game and Simulation Programming" at Narvik University College.
Pseudocode for the collision detection algorithm:
- Calculate the physical properties (velocity, displacement, acceleration, etc.) for the ball and the paddles.
- Looking for collision between the ball, the walls and the paddles. If any collision occur, create a collision object and register it in an array of collisions.
- Make the array of collisions unique by removing duplicated collision objects.
- Sort the array of collisions depending on the time of collision. The first collision should be handled first.
- For every collision object in the array:
- Pop the first element to handle.
- Move the ball (or the paddle) to the point of impact.
- Compute new physical properties.
- Looking for collision between the ball, the walls and the paddles for the remaining time step. Register collision object into the array of collisions if any collision occurs.
- Make the array of collision unique.
- Sort the array.
In this time step the ball is moving along the ds vector. The point of impact is at the "time" x along that vector. So in order to find the x value, we will first find the d vector, which is defined from the center of the ball p to the point qn.
Then we will find the green and the purple vector. The green vector is defined from the center of the ball p to the "time of impact" xds. And the purple vector is defined from the center of the ball p to the point qn. Both the vectors are in the same direction as the normal of the wall.
x, by putting the green vector and the purple vector equals each other into an equation.
x <, n> n = <d, n> n
- If x is in (0, 1], this would be the "time of impact".
- If x n> 0, then the ball is moving away from the wall.
- If x n< 1, then not a collision within this time step.
- If the <ds,n> is equals approximately to zero, then the ball is moving parallel with the wall.
Version 0.0.4 (08/12-2012)
Support score limit at 10 scores.
Version 0.0.3 (27/06-2012)
Version 0.0.2 (28/04-2012)
In this is version the audio is supported. It plays sound when the ball hits the paddles or the walls, and when the player scores.
Version 0.0.1 (20/04-2012)
This is the first development version. Currently the game support only two players mode and has no score limit.