(Simple) Game Math Tutorials

Started by
4 comments, last by PureSnowX 11 years, 3 months ago
One of the areas many people seem to struggle with most often when approaching game development tends to be game math. At least for 2D game programming, I have put together a series of tutorials that cover some of the most common problems you will face.

For each topic, I give a complete running application with full source code, a selection of just the math applicable code and a complete description ( with pretty pictures! ) describing the process, in plain non-scary English. Source is in JavaScript using EaselJS ( so it can run in a browser ), but the code is close enough that you can easily understand it if you know C,C++, D, Python, Java or C#. LISP programmers are out of luck.

Right now, there are recipes for:

Velocity and angled velocity ( two in one! )
Rotating to face another object
Rotating one object around another
Axis aligned bounding box – Intersections
Axis aligned bounding box – Rotation


So, if you are working on a game and are struggling with the math a bit, or are working on any of these topics, hopefully these will be of some use. I have a table of contents post, that contains all of the above, including the sample application on a single page.


I intend these to just be the beginning of a longer series of tutorials, so if you have specific topics you want covered, please let me know. Right now I am considering a*star ( pathfinding ), MinMax (Game Theory/Tic Tac Toe algorithm) and Bounding spheres/circles as upcoming topics, any other suggestions will be considered.

These recipes are all fairly simple, and aren't heavily optimized, they are intended for learning, but I have noted some areas that you could easily optimize. Hope some of you find them useful.
Advertisement
haha, I have already advertised this site to my college VGDC for some tutorials on the many things provided.
I have gone through some and it's really nicely setup.

haha, I have already advertised this site to my college VGDC for some tutorials on the many things provided.
I have gone through some and it's really nicely setup.


Thanks for the mention, what is VGDC btw?
Added another tutorial, Collision detection using bounding circles. Think of it like a rounded easier to deal with bounding box!
Added another recipe, this one by request. It shows how to handle sprite based shooting. The bullet will travel in the direction you click, the distance from the jetsprite determines the speed.

These are great!

Keep up the mighty fine work Serapth!

This topic is closed to new replies.

Advertisement