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.
(Simple) Game Math Tutorials
Started by Serapth, Dec 01 2012 06:50 PM
5 replies to this topic
Sponsor:
#4 Members - Reputation: 3375
Posted 12 December 2012 - 03:35 PM
Added another tutorial, Collision detection using bounding circles. Think of it like a rounded easier to deal with bounding box!
#5 Members - Reputation: 3375
Posted 20 December 2012 - 05:09 PM
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.






