
-----------------------------------
yodu123
Sun May 10, 2009 5:34 pm

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?

-----------------------------------
Dan
Sun May 10, 2009 6:01 pm

RE:2d motion
-----------------------------------
We need more information about what you are trying to do and what formulas you mean.

The most simple motion is just a loop witch changes the x,y qordents of a picture.

More info: 

[url=http://compsci.ca/v3/viewtopic.php?t=193]Smooth Animation / Moving Background
[url=http://compsci.ca/v3/viewtopic.php?t=376]Simple Draw Commands (Pixel Graphics)
[url=http://compsci.ca/v3/viewtopic.php?t=12533]View.Set and View.Update
[url=http://compsci.ca/v3/viewtopic.php?t=3678]LOOPs and FOR loops
[url=http://compsci.ca/v3/viewtopic.php?t=191]Pictures/Images

-----------------------------------
yodu123
Sun May 10, 2009 9:02 pm

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
Mon May 11, 2009 9:10 pm

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


end loop 

If you understand both physics and basic concepts of programming then you would be good to go.
