This extremely simple app is written in Java and plays on the browser. It is a simple representation of table tennis with many small details and strategies. It was developed independently during my free time in high school and it remains a somewhat solid experience that I am proud of, even so many years later.
This experience is a deceptively complex simple representation of the classic game of Tabletop Tennis. The ball is simulated in 3d space with its elevation represented by its size and an altitude meter in the top right of the screen. You use your mouse to control the paddle which will bounce the ball off of it at a reflected angle, but you can modify the trajectory of the ball in various ways. You can apply an immediate velocity change by using the arrow keys - up and down will make the ball fly more upwards or less upwards, as compared to moderately upwards - while left and right will give the ball more immediate left or right velocity. The advanced tactics of this game are shown when utilizing the mechanic of applying a delayed velocity change by having your paddle have left or right velocity when the ball collides with it, which will apply spin to the ball, giving it acceleration in a direction without directly applying velocity. If your paddle has forward or backward velocity when it collides with the ball it will have more or less velocity when it is reflected at your opponent, this also affects the ball's upward velocity when used in combination with the up and down arrow keys. The ball's spin will also affect how the ball bounces off of your opponent's paddle. Note: if your paddle is moving too quickly forward it is very easy for the ball to 'tunnel' through it without bouncing, this is due to the limited update loop speed and discrete collision checks.
The enemy you play against has 3 difficulty settings. Difficulty 1 is extremely slow-moving, moves directly toward the ball, has little regard about the direction it hits the ball back at you, and returns balls at a very slow speed. Difficulty 2 is similar to difficulty 1 except that it moves faster, returns balls at a higher speed, and attempts not to hit balls out of play. Difficulty 3 is extremely difficult to beat with very fast movement, high return speed, will return balls with spin, and has quadratic projectile motion ball prediction - it knows where the ball will land as soon as you hit it. All difficulties will attempt to dodge balls that are headed out of play and have a stamina system which will cause them to move much slower if you have been running their paddle across the board for a long time. Scoring is faithful to standard table tennis rules with the addition that if a player has a score of 7 while the other has not scored a point, the game is over. Otherwise, it is first to 11 and you must obtain a 2-point lead.
The game also features optional modifiers you can use to augment your experience. There are options to remove the maximum speed cap that the enemy can return a ball to making the ball invisible once it passes onto your side of the board to making the ball wobble significantly as it flies.
This entire project was developed independently. I performed all development tasks. Some highlights include:
Developed basic 2.5D physics system including collision, velocity, and acceleration
Created User Interface and mouse and keyboard input system using JS and Code.org Applab (for HTML page formatting)
Developed enemy AI utilizing quadratic projectile-motion prediction with 3 distinct difficulty levels, each introducing new behaviors
Developed table tennis scoring system and logic
Created a dynamic audio system with multiple sounds to decrease repetition and crowd noises after a long volley to increase tension
Developed multiple gameplay modifiers as an update to provide further gameplay