Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Can you make forever loops in different ways?
- aarushm22
- Scratcher
100+ posts
Can you make forever loops in different ways?
I want to know how to make forever loops in different ways!
Please put your example down below!
One person will win!
Please put your example down below!
One person will win!
Last edited by aarushm22 (March 7, 2016 23:21:06)
when you are on scratch :: events hatThis song is awesome:
have fun ::sensing
This is the singing part of a song and the insrumental song.
- aarushm22
- Scratcher
100+ posts
Can you make forever loops in different ways?
Below make codes to show me if you can make forever loops.
Use other blocks instead.
One person will win!
Use other blocks instead.
One person will win!
Last edited by aarushm22 (March 7, 2016 20:47:39)
when you are on scratch :: events hatThis song is awesome:
have fun ::sensing
This is the singing part of a song and the insrumental song.
- asivi
- Scratcher
1000+ posts
Can you make forever loops in different ways?
when green flag clicked
set [repeat v] to [true]
repeat until <<not (repeat)> = [true]>
set [repeat v] to [true]
...
end
Last edited by asivi (March 7, 2016 22:27:28)
- asivi
- Scratcher
1000+ posts
Can you make forever loops in different ways?
when green flag clicked
set [repeat v] to [true]
repeat until <<not (repeat)> = [true]>
...
set [repeat v] to [true]
end
- jokebookservice1
- Scratcher
1000+ posts
Can you make forever loops in different ways?
A method without variables:
repeat until <[1] = [2 ]>
your code
end
- asivi
- Scratcher
1000+ posts
Can you make forever loops in different ways?
repeat until <(timer) < (timer)
end
- asivi
- Scratcher
1000+ posts
Can you make forever loops in different ways?
A method whithout a method
repeat until <>
end
- TheLogFather
- Scratcher
1000+ posts
Can you make forever loops in different ways?
I can give you numerous ways, even without any kind of repeat blocks (see below, for example) – but… why…?
Using broadcast:
Using custom blocks:
Using backdrops:
Using timer:
Using clones:
Using broadcast:
when GF clicked
broadcast [infinite loop v]
when I receive [infinite loop v]
do stuff here...
broadcast [infinite loop v]
Using custom blocks:
when GF clicked
Infinite loop
define Infinite loop
do stuff here...
Infinite loop // note: this one might cause Flash crash if it loops very quickly?
Using backdrops:
when GF clicked
switch backdrop to [backdrop1 v]
when backdrop switches to [backdrop1 v]
do stuff here...
switch backdrop to [backdrop1 v]
Using timer:
when GF clicked
set [mextTime v] to [0.2]
when [timer v] > (nextTime) // Warning! -you will not be able to stop this one...
do stuff here...
set [nextTime v] to ( (timer) + (0.03) ) // (...unless you change this)
Using clones:
when GF clicked
create clone of [myself v]
when I start as a clone
do stuff here...
create clone of [myself v]
delete this clone
Last edited by TheLogFather (March 7, 2016 23:20:13)
Siggy the Kumquat slayer:
Main account: DadOfMrLog –– Frameworks for basic pen-rendered 3D in scratch (see studio). Examples:
- - - - 3D Text - - - - - - Simple shapes - - - Controllable structures - - - On the ground - - - - - - In space - - - -
- - - - 3D Text - - - - - - Simple shapes - - - Controllable structures - - - On the ground - - - - - - In space - - - -
- aarushm22
- Scratcher
100+ posts
Can you make forever loops in different ways?
{
I can give you numerous ways, even without any kind of repeat blocks (see below, for example) – but… why…?
Using broadcast:when GF clicked
broadcast [infinite loop v]
when I receive [infinite loop v]
do stuff here...
broadcast [infinite loop v]
Using custom blocks:when GF clicked
Infinite loop
define Infinite loop
do stuff here...
Infinite loop // note: this one might cause Flash crash if it loops very quickly?
Using backdrops:when GF clicked
switch backdrop to [backdrop1 v]
when backdrop switches to [backdrop1 v]
do stuff here...
switch backdrop to [backdrop1 v]
Using timer:when GF clicked
set [mextTime v] to [0.2]
when [timer v] > (nextTime) // Warning! -you will not be able to stop this one...
do stuff here...
set [nextTime v] to ( (timer) + (0.03) ) // (...unless you change this)
Using clones:when GF clicked
create clone of [myself v]
when I start as a clone
do stuff here...
create clone of [myself v]
delete this clone
when you are on scratch :: events hatThis song is awesome:
have fun ::sensing
This is the singing part of a song and the insrumental song.
- aarushm22
- Scratcher
100+ posts
Can you make forever loops in different ways?
when green flag clicked
move (10) steps
when you are on scratch :: events hatThis song is awesome:
have fun ::sensing
This is the singing part of a song and the insrumental song.
- aarushm22
- Scratcher
100+ posts
Can you make forever loops in different ways?
jokebookservice1 and TheLogFather won. TheLogFather won.
when you are on scratch :: events hatThis song is awesome:
have fun ::sensing
This is the singing part of a song and the insrumental song.
- TheLogFather
- Scratcher
1000+ posts
Can you make forever loops in different ways?
Well, if you want really silly, here's one using video motion…
// (note: do not even need green-flag script)
when [video motion v] > (0)
turn video [off v]
do stuff here...
turn video [on v]
Last edited by TheLogFather (March 7, 2016 23:42:06)
Siggy the Kumquat slayer:
Main account: DadOfMrLog –– Frameworks for basic pen-rendered 3D in scratch (see studio). Examples:
- - - - 3D Text - - - - - - Simple shapes - - - Controllable structures - - - On the ground - - - - - - In space - - - -
- - - - 3D Text - - - - - - Simple shapes - - - Controllable structures - - - On the ground - - - - - - In space - - - -
- jokebookservice1
- Scratcher
1000+ posts
Can you make forever loops in different ways?
repeat until <>Because empty == false
end
- aarushm22
- Scratcher
100+ posts
Can you make forever loops in different ways?
wwhen green flag clicked
repeat while <1==1>
your code//
end
when you are on scratch :: events hatThis song is awesome:
have fun ::sensing
This is the singing part of a song and the insrumental song.
- aarushm22
- Scratcher
100+ posts
Can you make forever loops in different ways?
repeat until <1=1>
code//
end
when you are on scratch :: events hatThis song is awesome:
have fun ::sensing
This is the singing part of a song and the insrumental song.
- greenfire3454
- Scratcher
100+ posts
Can you make forever loops in different ways?
when [(timer) v] > (0.0000001)
broadcast [start v]
when I receive [start v]
repeat <[1] = [2 ]>
turn ccw (5) degrees
end
when green flag clicked
broadcast [start v]
fail stands for first attempt in leaning
just keep moving forward
when green flag clicked
forever
imagine::motion
program::sound
share::operators
end
- greenfire3454
- Scratcher
100+ posts
Can you make forever loops in different ways?
ill go for ever
forever and ever
end
fail stands for first attempt in leaning
just keep moving forward
when green flag clicked
forever
imagine::motion
program::sound
share::operators
end
- greenfire3454
- Scratcher
100+ posts
Can you make forever loops in different ways?
that dint work
<<I> <p >>
fail stands for first attempt in leaning
just keep moving forward
when green flag clicked
forever
imagine::motion
program::sound
share::operators
end
- greenfire3454
- Scratcher
100+ posts
Can you make forever loops in different ways?
i Quote this because there is a while block its hacked but it works wwhen green flag clicked
repeat while <1==1>
your code//
end
it looks like thiswhile <<this i where you put yor things like> and < <touching [sprite1 v] ?>>>well not relly like that because this program cant get the pic it was more like
endrepeat until <>its just it had while on the top
end
fail stands for first attempt in leaning
just keep moving forward
when green flag clicked
forever
imagine::motion
program::sound
share::operators
end
- Discussion Forums
- » Help with Scripts
- » Can you make forever loops in different ways?