PDA

View Full Version : 2D game math



kryton9
29-04-2008, 06:48
I just watched a very nice video tutorial on 3DBuzz. It is for c# and xna, but the key thing I watched it for was the math required to handle the camera, level, player and enemy math.

I think any of you ever interested in doing a 2D game will find it interesting to watch to see how you figure out all the offsets involved.
Don't let the c# scare you, the presentation of the thought process for understanding the math is really demonstrated very nicely.

http://www.3dbuzz.com/vbforum/sv_home.php?v=9

Petr Schreiber
29-04-2008, 09:01
Thanks Kent,

I almost forgot that XNA/D3D has different way of defining the texture coordinates, comparing to OpenGL.


Bye,
Petr

matthew
29-04-2008, 14:10
I downloaded XNA & C# Express when I got my new computer but I didn't like it. :(

I find OpenGL much easier to understand. :D

Michael Hartlef
29-04-2008, 17:49
Yes, Opengl is much easier to understand. For me too.

kryton9
29-04-2008, 21:59
I agree with opengl being easier to understand than directx. The 0,0 equals the top left of the screen is so crazy in directx. I don't see the logic to that at all.
But I thought the video's discussion of how the camera is set to the player location and the player is in the middle of the screen, at least till the bounds of the level are approached was neat. How the enemy speed is calculated along the line with linear interpolation was neat too.