Discuss Scratch

mlcreater
Scratcher
1000+ posts

"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)

I like the idea of this block; I think people would use it for Mario-style games, like:

when @greenFlag clicked
run {
forever {
if <key [up arrow v] pressed?> then {
repeat (10) {
change y by (2)
} @loopArrow :: control stack
repeat (10) {
change y by (-2)
} @loopArrow :: control stack
} :: control stack
} @loopArrow :: control cap
} while running {
forever {
if <key [left arrow v] pressed?> then {
change x by (-2)
} :: control stack
if <key [right arrow v] pressed?> then {
change x by (2)
} :: control stack
} @loopArrow :: control cap
} :: control stack
xXRedTheCoderXx
Scratcher
1000+ posts

"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)

mlcreater wrote:

I like the idea of this block; I think people would use it for Mario-style games, like:

when @greenFlag clicked
run {
forever {
if <key [up arrow v] pressed?> then {
repeat (10) {
change y by (2)
} @loopArrow :: control stack
repeat (10) {
change y by (-2)
} @loopArrow :: control stack
} :: control stack
} @loopArrow :: control cap
} while running {
forever {
if <key [left arrow v] pressed?> then {
change x by (-2)
} :: control stack
if <key [right arrow v] pressed?> then {
change x by (2)
} :: control stack
} @loopArrow :: control cap
} :: control stack
Oh, cool, nice use!
BosenChang
Scratcher
1000+ posts

"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)

I wish to bump this topic up (for xXTheRedCoderXx)
BosenChang
Scratcher
1000+ posts

"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)

(yup, I guessed I made this more popular)
xXRedTheCoderXx
Scratcher
1000+ posts

"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)

BosenChang wrote:

I wish to bump this topic up (for xXTheRedCoderXx)
Thanks.
DabDatBass
Scratcher
1000+ posts

"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)

run {

}while running{


}::control
run {

}while running{


}::control

Last edited by DabDatBass (July 20, 2020 16:56:43)

BosenChang
Scratcher
1000+ posts

"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)

DabDatBass wrote:

run {

}while running{


}::control
run {

}while running{


}::control
Do you support this or not?
HTML-Fan
Scratcher
1000+ posts

"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)

I don't like multitasking (and I was totally confused when I read “new C block”, I was like “Well … that command at least doesn't exist in C++.”) and you can use a bunch of messages. Would the second process stop as soon as the first process finishes?
DabDatBass
Scratcher
1000+ posts

"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)

BosenChang wrote:

DabDatBass wrote:

run {

}while running{


}::control
run {

}while running{


}::control
Do you support this or not?
yes i do, see my post on this topic
DabDatBass
Scratcher
1000+ posts

"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)

HTML-Fan wrote:

…Would the second process stop as soon as the first process finishes?
no, it does both at the same time. if one script finishes, it waits until the second one finishes , e.t.c. ex:

//does both at same time
run {
move (5) steps
turn cw (15) degrees
//[Let's say this one finishes first, now it waits for the other one to finish]::custom
}while running{
repeat until <[5] = (i)>
change [i v] by (1)
//[the script is also running whilest the top script is running. this doesn't begin when the top script finishes]::custom
add (i) to [list v]
end
}::control

Last edited by DabDatBass (July 20, 2020 17:07:28)

HTML-Fan
Scratcher
1000+ posts

"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)

DabDatBass wrote:

HTML-Fan wrote:

…Would the second process stop as soon as the first process finishes?
no, it does both at the same time. if one script finishes, it waits until the second one finishes , e.t.c. ex:

//does both at same time
run {
move (5) steps
turn cw (15) degrees
//[Let's say this one finishes first, now it waits for the other one to finish]::custom
}while running{
repeat until <[5] = (i)>
change [i v] by (1)
//[the script is also running whilest the top script is running. this doesn't begin when the top script finishes]::custom
add (i) to [list v]
end
}::control
Did red said that or do you guess that that's what you assume?
pikachurock
Scratcher
100+ posts

"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)

Support. While i suck at coding and i hardly use it, i think it would be nice!
Maximouse
Scratcher
1000+ posts

"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)

HTML-Fan wrote:

Would the second process stop as soon as the first process finishes?
It would either wait until both finish (probably a better solution) or return immediately, running that code in the background (complicated and confusing, but would work).
HTML-Fan
Scratcher
1000+ posts

"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)

Yeah. That's where it starts to be confusing, forever-if-like.
BosenChang
Scratcher
1000+ posts

"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)

Or run this:
run and repeat if finished{
...
}while running and repeat if finished{
...
}:: control
MrFluffyPenguins
Scratcher
1000+ posts

"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)

HTML-Fan wrote:

Yeah. That's where it starts to be confusing, forever-if-like.
forever if isn't that confusing
if it was like this:
if <> then
forever

end
end
it would be if <> forever

but it's not, its like this:
forever
if <> then

end
end
DabDatBass
Scratcher
1000+ posts

"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)

Mr_PenguinAlex wrote:

HTML-Fan wrote:

Yeah. That's where it starts to be confusing, forever-if-like.
forever if isn't that confusing
if it was like this:
if <> then
forever

end
end
it would be if <> forever

but it's not, its like this:
forever
if <> then

end
end
no, forever if is that, if something is done, then it does it 'til it is not done.

forever
broadcast [thing v] and wait
end
when I receive [thing v]
if <thing> then
forever
thing
if <not<thing>> then
stop [this script v]
end
end
end

Last edited by DabDatBass (July 20, 2020 17:35:05)

DabDatBass
Scratcher
1000+ posts

"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)

use this link to see Scratch 1.4, when the forever-if then block was not deleted
scratch978654
Scratcher
100+ posts

"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)

Semi-support because it would be a great and useful feature (especially for NSes) but it would lag out Scratch.
xXRedTheCoderXx
Scratcher
1000+ posts

"Run, and run" E block (READ THE ENTIRE OP BEFORE POSTING)

scratch978654 wrote:

Semi-support because it would be a great and useful feature (especially for NSes) but it would lag out Scratch.
No it wouldn't. I don't think it will, at least. What makes you say that?

HTML-Fan wrote:

Did red said that or do you guess that that's what you assume?
I did.

Powered by DjangoBB