Multiple Object Movements in Turing
Author |
Message |
Mark0213
|
Posted: Wed Dec 07, 2011 9:15 pm Post subject: Multiple Object Movements in Turing |
|
|
What is it you are trying to achieve?
<Replace all the <> with your answers/code and remove the <>>
I made a game like the frog game, I understand how to move one ball back and forth on the screen, but i dont understand how to move several balls
at the same time, if anyone can help me, please post back with tips-thanks! i dont know much about velocity or speed thingies
What is the problem you are having?
<Answer Here>
Describe what you have tried to solve this problem
<Answer Here>
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<Answer Here>
Turing: |
<Add your code here>
|
Please specify what version of Turing you are using
<Answer Here> |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Insectoid
|
Posted: Wed Dec 07, 2011 9:26 pm Post subject: RE:Multiple Object Movements in Turing |
|
|
Many people have asked this question before. There are many tutorials explaining exactly this. Search through the Tutorial section and the Turing Walkthrough. |
|
|
|
|
|
Tony
|
Posted: Wed Dec 07, 2011 9:27 pm Post subject: RE:Multiple Object Movements in Turing |
|
|
the answer, in its most basic form is that:
- you start a frame
- move the first ball
- move the second ball
- start a second frame
between frame 1 and frame 2, all of the balls have moved. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
Mark0213
|
Posted: Wed Dec 07, 2011 9:44 pm Post subject: RE:Multiple Object Movements in Turing |
|
|
Tony, how would you start a frame, if you help me with that i can figure this out, and between the primary, and secondary frame you can input as much balls as you can, or is it limited to one, and you must put multiple frames-I'll try and do it all on my own just for the frame part is my only problem-Thanks for your time and consideration! means alot to me Tony |
|
|
|
|
|
Dreadnought
|
Posted: Wed Dec 07, 2011 10:00 pm Post subject: Re: Multiple Object Movements in Turing |
|
|
Well, you want the second frame after the first, the third after the second, and so on. On each frame you are doing something very similar to what was done on the last frame (moving the balls). So you want to loop over your code for each frame.
The basic idea is:
Turing: | loop
<Stuff>
% Start Frame
<Move first ball>
<Move second ball>
...
% End frame
<More Stuff>
end loop
|
Note that "stuff" is just other code you might have in your loop. Also, notice that your doing something similar to each ball, maybe you could use a loop to clean that up (but its more complicated). |
|
|
|
|
|
Insectoid
|
Posted: Wed Dec 07, 2011 10:02 pm Post subject: RE:Multiple Object Movements in Turing |
|
|
By 'frame' Tony means one iteration of the main loop (a very, very loose definition). You do everything in one loop. Move all your balls a little bit, all in the same loop (you do NOT need more than one loop in your entire program for 2-3 balls). |
|
|
|
|
|
|
|