PDA

View Full Version : Where Do I use loop and how?


disboijoe
12-07-2009, 02:17 AM
my project needs me to use:
-at least two loops (a block of codes that repeats consecutively for a specified number of iterations or until a condition is met)
-at least 3 new methods with at least one of them being called (executed) in two or more places in the program (not executed consecutively-that would be a loop)

I tried using loop 5times and thought it would make the bunny jump 5times while the other things are going on in the world, but instead it makes the bunny jump 5times and then everything will start. So i resorted to making the bunny loop 1time and then everything starts. I wanted to make the bunny jump on its own while the other things in the world are happening.

Is that how I'm suppose to be using these loop? I'm trying include those rules above into my world but dont know if I'm even doing it right. Also I have no idea what my teacher means by execute.

x2495iiii
12-07-2009, 02:34 AM
If you put the loops in a do together method with the rest of the things going on in the world, or put the bunny loop and the rest of the world's code in separate "when the world starts" events, they'll happen at the same time.

disboijoe
12-07-2009, 12:07 PM
could you write a sample command. I'm lost.

woud it be like this then:

Do together
-loop
-bunny1
-bunny2
-bunny3

and not like this:

Loop
-Do together
-bunny1
-bunny2
-bunny3

disboijoe
12-07-2009, 02:30 PM
alright thanks, I'll see what i can do.