Original Post
Hi there, I've recently taken to teaching myself how to make simple computer games and have made a pong clone and simple space invaders clone. However for both of those games I had one eye on a tutorial to guide me through the trickier aspects. Now I've decided to make a breakout clone in an earnest attempt to making a game of my own (i.e without following a tutorial). I'm a bit stuck on the maths involved for breakout however. I know the maths is similar to what is in the pong clone as far as making the ball rebound off walls and the paddle, and whatnot. When I was following the pong tutorial, I thought I understood what was going on sufficiently, however when I come to implement similar functionality in breakout I for the life of me can't write the necessary code on my own (without taking a sneak peek at the pong code). I could just copy the code from pong, but that isn't going to solve much with regards to my proper understanding of the topic. I understand this is one problem with following a tutorial, but I don't follow them blindly just racing along to get to the end product, instead I try my best to understand exactly what each line of code is doing and think about how it would be applied to other projects, and have learned a great deal by doing tutorials this way. However I'm getting frustrated at not being able implement the maths involved with what I imagine to be a relatively primitive game. I'm not bad at maths, it was always one of my best subjects at high school, and was competent at university level (only really doing intro calculus) but that was more due to a lack of application rather than a lack of ability (not sure how they made university maths so dull, but they did). I guess my question is what sort of maths is involved in the development of 2D games? I appreciate 'maths' is quite a broad term, and will likely encompass physics and other topics (which always seemed to me like applied maths). I'm not interested in 3D maths at this stage (although there may be a crossover between them, I don't know). Also does anyone have any good starting points for (re)acquainting myself with some of these topics (for example my trig is very hazy)? Also as a windows developer by trade, I appreciate that often it takes practice and experience to be able to just do things off the top of my head. There seems to be a multitude of references for 3D maths, but very little for 2D maths. I'm just a little disheartened at not being able remember (and subsequently recall) the necessary maths involved with something as seemingly simple as rebounding a ball off a wall. Any advice, tips, or references about how to get beyond this next hurdle would be hugely appreciated. Sorry if the topic is a bit muddled, and possibly a bit unclear. Articulation was never one of my strong points. Cheers, Gray