2d motion
Author |
Message |
yodu123
|
Posted: Sun May 10, 2009 5:34 pm Post subject: 2d motion |
|
|
i am thinking to use 2d motion for car racing game but i don`t know how i`m going to use those formulas in programing can someone tell me how? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Dan
|
|
|
|
|
yodu123
|
Posted: Sun May 10, 2009 9:02 pm Post subject: RE:2d motion |
|
|
okay when the car is moving i need t calculate the y and x at the same time because i don`t want it to go just straight
so for the x value the formula would be x= speed*time+(1/2) acceleration *time^2
and same thing for the y
i also have to find the acceleration, the speed and the time. i also have to calculate the angle in which the picture would rotate when the car turns at some point |
|
|
|
|
|
OneTwo
|
Posted: Mon May 11, 2009 9:10 pm Post subject: RE:2d motion |
|
|
It seems your lacking experience in programming, I suggest you try simpler problems first so that you start to understand how you would approach this kind of problem. Secondly, if you haven't already, you need to understand the physics formulas that you will be using so that you know how to incorporate it. For example, your car accelerates at a constant accelleration when you press the forward arrow key.
Loop
<CODE TO DETECT WHAT KEY IS PRESSED>
<CODE TO CALCULATE DISTANCE TRAVELLED>
end loop
If you understand both physics and basic concepts of programming then you would be good to go. |
|
|
|
|
|
|
|