This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-08-14 15:14:02

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Problem with Repeat Until?

I made this project thats ment to rotate a sprite AND glide to a location if the sprite isnt in that location. the gliding works fine, but the rotating wont stop at all. Infact, either script stops running when the sprite reaches the location I want it to. Heres the script im running now:
[blocks]
<when green flag clicked>
<if><<  <not>  <<<( <x position>  <=> -38 )>  <and><( <y position> <=> 1 )>  >>>>
<repeat until><<<( <x position> <=> -38 )>  <and><( <y position>  <=> 1 )>  >>
[/blocks]
I dunno why it wont stop.

Last edited by DigiTechs (2011-08-14 15:16:00)


I'm back.
Maybe.

Offline

 

#2 2011-08-16 18:03:15

poemon1
Scratcher
Registered: 2011-01-12
Posts: 500+

Re: Problem with Repeat Until?

Same Here........


http://i47.tinypic.com/rrqe13.gif

Offline

 

#3 2011-08-16 18:06:46

gettysburg11
Scratcher
Registered: 2008-06-14
Posts: 1000+

Re: Problem with Repeat Until?

After the repeat until, you have to tell it to stop. It knows to keep repeating until the sprite gets to where you want it to get to, but it doesn't know what to do after it gets there.


http://i256.photobucket.com/albums/hh184/mnacmilan/LOGO_ACMILAN-Splash.gif

Offline

 

#4 2011-08-16 18:10:22

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: Problem with Repeat Until?

What goes inside your "repeat until"?

Offline

 

#5 2011-08-17 06:29:34

LFCm4d227
New Scratcher
Registered: 2011-08-03
Posts: 16

Re: Problem with Repeat Until?

Instead of using repeat until, try using forever if.

Sorry, I haven't quite worked out how to actually put the scipt in like you did, but it would look something like this:

Forever if    not    x position = -38    and    not    y position = 1
Glide 3 secs to x: -38 y: 1
Turn right 5 degrees

Obviously you can change the numbers so it glides slower or faster, and you can change how much in turns.

Offline

 

#6 2011-08-17 06:36:08

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Re: Problem with Repeat Until?

LFC, i tried that too, it didnt work. It just kept rotating as before.


I'm back.
Maybe.

Offline

 

#7 2011-08-17 06:37:30

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Re: Problem with Repeat Until?

kayybee wrote:

What goes inside your "repeat until"?

You mean the statement that proves T/F? Thats in the topic post. If you ment inside the C bracquet, theres no need for that.


I'm back.
Maybe.

Offline

 

#8 2011-08-17 06:38:54

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Re: Problem with Repeat Until?

poemon1 wrote:

Same Here........

*offtopic: Your signiture is funny if I say.*
Back on topic: Help??


I'm back.
Maybe.

Offline

 

Board footer