Original Post
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.
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.