Ping Pong Game


Game Description:

It's pretty straightforward. You just play the Ping Pong game with your mouse. I choose to make this game because playing ping pong is in my entire life. I play ping pong for more than 20 years and almost 10 years in the professional league in China. For me, a large portion of my life is playing competitions, losing competitions, and practicing more. I always lose because, for each competition, there would only be one person who doesn't lose. Competitions are cruel and I just kept practicing to win more.

The challenging parts:

Making 3D projection onto 2D canvas without using WebGL
Organize codes for game design and future extension.

Play Tips:

  1. Click to serve

  2. You don't need to click to return the ball

  3. The capsule shows your hitting area, hit the ball inside that area


Prototyping Sketch:

Prototyping Game Physics and 3D Projection:

Game Prototype

Made My Own Capsule Collider to Detect if the Ball is Hit:

Reflection From this Project

This is a huge project for me. Thanks to my previous experience with Unity, I had an idea of how game engines work. I had a lot of iterations for this project mainly because I didn't organize my JS files like a game engine. It's hard to expand a player's skill set if this game is not written like a formal game engine. Thus, I spent almost two days reorganizing my codes, so that I can add detection and game mechanics there

The last version is pretty organized and it's very flexible for adding new skills for players to use. My original idea is to incorporate cool things from the Prince of Tennis. Apparently, I don't have enough time for that, and debugging took so much time.

For this Project, I Tried a lot of (New) Things:

1. Writing scene managers:
It now makes sense to me how it's really working behind Unity. I didn't use switch here because my game is a little bit too complex to use "switch" to organize my file. I use "switch at other places though

2. Writing Capsule Collider:
Not really a new thing for me. This is like a revision. I used to write shaders with raymarching to make a 3D capsule, so it's not too challenging for me here. The math is simple here

3. Writing Basic Physics:
This is also an interesting but not so challenging part.

4. Use of Class:
First time really using a lot of classes in my project. I find a lot of new ways to use the class. It's awesome.

5. Adding Sound Effects:
Sound effects are always cool to add to a game. I really like the sounds here.

My Championship in Columbia’s Tournament