Author Topic: Mathematics for game programming  (Read 5449 times)

dragomrak

  • Guest
Mathematics for game programming
« on: February 07, 2016, 05:26:02 PM »
Hello,

I tried to understand some code examples and now I got one question, which seems to be rather important for me. What do you think, how much mathematical knowledge I should have to do 2d game programmes. I am really not good in mathematics. Perhaps I undertstand things like the sentence of Pythagoras, but I never would have any idea, that I have to use it in a specific situation. And unfortunately I have no idea how sinus, cosinus and so on work. It should be possible to understand it ( ;-) ) but even if I manage to understand that, I would  not have any idea that I have to use it in a specific situation. I think that I have to know all that and - more important -  to know, when I have to use that. But obviously I am the greatest mathematical fool on earth. Mathematical issues don't reach my brain. That might be a problem. Does anybody understand, what I mean?

B+

  • Guest
Re: Mathematics for game programming
« Reply #1 on: February 07, 2016, 05:44:01 PM »
Hi Dragomrak,

We can try a little math course, dialogue if you want.

My guess is that you don't know the difference between radians and degrees for angle measures?

Probably need to get that straightened out first, to use SIN and COS functions because they deal with angles.

On the other hand, the use of SIN and COS, trig functions, is rare especially for those who avoid math and you might get a ways into game programming without that knowledge, just copy someone else code.
« Last Edit: February 07, 2016, 05:59:24 PM by B+ »

dragomrak

  • Guest
Re: Mathematics for game programming
« Reply #2 on: February 07, 2016, 06:21:06 PM »
Hi B+,

many thanks for you offer to start a little maths course. That touches my problem exactly.  If you say, that trig functions are rare then I can try to learn the rest but if I come to the point, where I need them I would even not recognize that I need them. I read some tutorials and books regarding game programming, but there always routines, where I need them. So in this case I have to use some else code. That could be a solution. Perhaps I should try text games. ;-)


B+

  • Guest
Re: Mathematics for game programming
« Reply #3 on: February 07, 2016, 06:25:08 PM »
There are all kinds of games. Yes, fun can be yours with text or dialogue type games.

Games can teach too, and in fun way!

dragomrak

  • Guest
Re: Mathematics for game programming
« Reply #4 on: February 07, 2016, 06:44:29 PM »
Can I overcome that problem, when I use sprites instead of figures, which I have to draw myself? As far as I understood I can move a sprite on a background and detect kollisions without that stuff. Is that wrong?

B+

  • Guest
Re: Mathematics for game programming
« Reply #5 on: February 07, 2016, 07:06:41 PM »
I am not a sprite expert but as I understand it, moving a sprite around a screen is like moving a rectangle around a screen.

If you can draw rectangles at different points, then you can "draw" sprites at different points on screen.

Collisions of sprites is a matter of one rectangle running into or overlapping another, as I understand the problem.

I hope someone else will correct me, if I am wrong.

dragomrak

  • Guest
Re: Mathematics for game programming
« Reply #6 on: February 07, 2016, 07:17:14 PM »
As I understood sprites so far, the are pictures (bmp, jpg...) which are displayed on the screen. You can move them easily and - for example - JB, Blitzbasic or other Basics - have functions to detect collisions. I tried a little game in BlitzBasic, which is a german Basic for 2d game development, some years ago. It displayed some sprites. They jumped around, made noises, beeps and so on and when the have a collision, something happended, points for the enemy, what ever. I did not get very far, but that worked and without any trig function.

B+

  • Guest
Re: Mathematics for game programming
« Reply #7 on: February 07, 2016, 07:43:37 PM »
Yes many gaming dialects have collision detection. Probably ones talked about here at this site have that!