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

#1 2009-12-30 10:46:15

jukyter
Scratcher
Registered: 2009-12-06
Posts: 1000+

Help on making pause and play?

I want to make a pause and play button for my animation! Does anyone know how?<stop all> Would be pause, but play? Any ideas?


cause a bird and a fish could fall in love/but where would they live?

Offline

 

#2 2009-12-30 10:55:51

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Help on making pause and play?

Try using the Wait Until block with a variable named Run.

[blocks]
<when green flag clicked>
<set{ Run   }to( Yes
<forever>
<wait until><( <{ Run   }> <=> Yes )>
<next costume>
<wait( .2 )secsc>
<end>
[/blocks]

And then have another sprite set up as a button to change the value of the Run variable

[blocks]
<when[ Pause Button ]clicked>
<if> <( <{ Run   }> <=> Yes )>
<set{ Run   }to( No
<else>
<set{ Run   }to( Yes
<end>
[/blocks]


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#3 2009-12-31 04:53:35

jukyter
Scratcher
Registered: 2009-12-06
Posts: 1000+

Re: Help on making pause and play?

Paddle2See wrote:

Try using the Wait Until block with a variable named Run.

[blocks]
<when green flag clicked>
<set{ Run   }to( Yes
<forever>
<wait until><( <{ Run   }> <=> Yes )>
<next costume>
<wait( .2 )secsc>
<end>
[/blocks]

And then have another sprite set up as a button to change the value of the Run variable

[blocks]
<when[ Pause Button ]clicked>
<if> <( <{ Run   }> <=> Yes )>
<set{ Run   }to( No
<else>
<set{ Run   }to( Yes
<end>
[/blocks]

Thanks Paddle2Se


cause a bird and a fish could fall in love/but where would they live?

Offline

 

Board footer