hi there, i'm beginner in creating/developing games. so i figured out that i should build a simple game, maybe a clone to hone my skills in programming and game design. the game of choice was a simple PONG game.
the game simply consists of
1-Paddle
2-ball
my problem is that i can't figure out how to make a formula that makes the ball rebound with speed based on
1-the moving speed of the paddle
2-the direction where the paddle was moving
3-the speed of the ball when it hit the paddle
However my question isn't how to solve this specific problem, but i want a general way/method about how to Create mathematical formulas whenever i need one. i don't know what is that even called so i couldn't find any answer just using google.
so giving me any link, material, tutorial, exercises, technique or Even the correct keywords to make me able to search this topic will be highly appreciated
note: after searching i found one answer which i think kinda fits my question which was:
- Do you want the value to grow at a constant rate? Use a linear function.
- Do you want the value to grow slow at first, but fast later? Use a polynomial or exponential function.
- Do you want the value to grow fast at first, and slow down later? Use an nth-root or logarithmic function.
- Do you want the value to grow slowly at the start/end but fast in the middle? Or do you want it to grow quickly but still have an upper-bound? Use a sigmoid curve, such as atan or the logistic function.
- Do you want the value to oscillate? Use a sin or some other wave.
which i wasn't able to apply to my game, cause i just don't know how to do that. for instance is the linear function mentioned here is this y=mx+c if so how to apply this to my game, can i make it take more than two parameters? if not what does linear functions mean and how to create one?
this is the problem i stuck with and i don't know where to begin to solve this problem is it by doing more math exercises or learning some more abstract math.... i hope that i made my self clear.
of course you can ask me for any more info.