views:

2468

answers:

8

I want to program graphical 2D games more complex than the basic 2D stuff I already know. I don't want to do 3D programming. Just more complex 2D stuff. I dropped high school before I could learn a lot of stuff so I walked away with enough algebra knowledge to balance my checkbook and do some light 2D Cartesian programming.

Are there any good resources out there for a guy with a limited attention span (say 20 minutes apiece for a subject I'm keenly interested in) to learn, gradually, how to do something more useful with math in programming?

+5  A: 

I'm currently going through "Physics for Game Developers" by David M. Bourg. So far, I'd recommend it.

It provides the math-y concepts behind physics that can easily be applied to the 2D realm to spice up your games a bit.

Gabriel Isenberg
A: 

Strangely I've found a lot of useful stuff on linear algebra in Wikipedia: http://en.wikipedia.org/wiki/Portal:Mathematics

Generally it's not the best source of knowledge, but math there is ok.

akalenuk
+10  A: 

You need to be competent in Trigonometry: Wikipedia and Mathworld

Even though you don't wish to do 3D programming, 2D games also use vectors and matrices. (from Linear Algebra)

Linear Algebra resources: Wikepedia and Mathworld

One point that will save you a lot of effort in Trig programming is realizing the need for the atan2() function, rather than the atan() function. This is important when determining the direction between two points.

Being able to move between various coordinate systems is a big plus. This will come with experience. Two common things that trip people up are:

a) Most screen systems place the origin (0,0) in the upper left corner, with the positive x axis extending to the right and the positive y axis extending down. Standard Cartesian coordinates suppose the origin of Quadrant 1 (where x and y are always positive or zero) in the lower left. This requires a programmer to 'flip' the y orientation at some stage.

b) Typical geography places 0 degrees as North and positive degrees sweep clockwise. All the Trig functions place 0 degrees as East with positive degrees sweeping counter-clockwise.

Finally, even though we tend to think in degrees, real libraries will use radians. A best practice is to store angles as radians (in 'math' orientation rather than 'geo') and convert things when displaying debug information..

TomZ
A: 

I recommend Wolfram's resources: http://mathworld.wolfram.com

They're thick, but I know of no better online resource.

warren
+1  A: 

I have to disagree with the recommendation of Physics for Game Developers.

I found that book pretty boring, and I wouldn't call my own attention span that short.

I would say the top things to get good at are vectors, using trig to manipulate them, and then on top of that foundation you apply whatever physics are specific to your current project.

I'd just fire up google/wikipedia and start bouncing around the web soaking up random stuff, and when your limited attention span gets antsy, bounce again.

Taking on that book is probably not going to suck you in and inspire you.

rice
+3  A: 

GameDev.net has a section of articles for Math and Physics coding. It's worth a quick look through to see if anything is related to what you're trying to do.

http://www.gamedev.net/reference/list.asp?categoryid=28

Jon Tackabury
A: 

If you want a general math website I'd recommend planetmath.org. The articles there tend to hold a higher standard than wikipedia (which in my experience can be downright appalling when it comes to math) and are more user friendly than mathworld. Mathworld is good if you are a mathematician and need the complete correct definition of some term, but for day to day use it tends to be far to theoretical and obtuse.

+1  A: 

If you live in the US, how about enrolling at a local community college to take those math classes you missed? They will have resources available to help students who need remedial skills classes and may have a learning disability. You have an incentive to learn and you now realize the value of the education. There's no shame in wanting to learn. See an academic counselor and they'll help you out. Go for it.

Barry Brown