Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 2d motion
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
yodu123




PostPosted: 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
Sponsor
sponsor
Dan




PostPosted: Sun May 10, 2009 6:01 pm   Post subject: 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:

Smooth Animation / Moving Background
Simple Draw Commands (Pixel Graphics)
View.Set and View.Update
LOOPs and FOR loops
Pictures/Images
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
yodu123




PostPosted: 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




PostPosted: 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.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: