Discuss Scratch

Mr_PenguinAlex
Scratcher
1000+ posts

jump block

This is not a physics block. It goes to a specific part of the code, not actually jumping.

I was playing a game called Human Resource Machine (it's about coding) and it had something Scratch could have!
It's called “jump”.
When you put it into the code, you select a part of the code that it would go to. When the block is activated, it goes to that selected part of the code.

For example:
when green flag clicked
jump :: motion
if <[pigs fly] = [true]> then
stop [all v]
end
‎‎‎‎                           :: motion // this is where the jump goes to
As far as I know, this is not workaroundable (except for broadcasts but those are a pain to use if your dealing with clones), and it could be used to break out of forever loops and such. There would be an arrow going from the jump block to where it is jumping, to show where it will go.

Last edited by Mr_PenguinAlex (Aug. 7, 2020 02:25:57)


ioton
Scratcher
500+ posts

jump block

How about
jump to end{

} :: motion
but flipped? (meaning that the closed end would be on the right side of the script and the open end on the left side)
don't ask me how dragging blocks into it would work

Last edited by ioton (Aug. 6, 2020 19:34:29)



▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓
▓░░█████░░██████░░█████░░██████░░█░░░█░░░▓
▓░░░▒█▒▒▒░█▒▒▒▒█▒░░▒█▒▒▒░█▒▒▒▒█▒░██░░█▒░░▓
▓░░░░█▒░░░█▒░░░█▒░░░█▒░░░█▒░░░█▒░█▒█░█▒░░▓
▓░░░░█▒░░░█▒░░░█▒░░░█▒░░░█▒░░░█▒░█▒░██▒░░▓
▓░░█████░░██████▒░░░█▒░░░██████▒░█▒░░█▒░░▓
▓░░░▒▒▒▒▒░░▒▒▒▒▒▒░░░░▒░░░░▒▒▒▒▒▒░░▒░░░▒░░▓
▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
Mr_PenguinAlex
Scratcher
1000+ posts

jump block

bump

Basic88
Scratcher
1000+ posts

jump block

Support! The physics behind the workaround are hard (especially for a beginner).

Last edited by Basic88 (Aug. 7, 2020 01:25:07)


I have moved to @BrowserExtension
LankyBox01
Scratcher
1000+ posts

jump block

Support!
I don't use the operators, i use the Repeat () block and it isn't that smooth!

Do you have trouble with scratch slang? Check this awesome site out!

I'm a red panda btw
scratchastroLOL
Scratcher
1000+ posts

jump block

I think this probably belongs in Control rather than Motion…
Mr_PenguinAlex
Scratcher
1000+ posts

jump block

scratchastroLOL wrote:

I think this probably belongs in Control rather than Motion…
i only made it a motion block because it was blue, just like the jump block in Human Resource Machine.

LankyBox01
Scratcher
1000+ posts

jump block

Mr_PenguinAlex wrote:

scratchastroLOL wrote:

I think this probably belongs in Control rather than Motion…
i only made it a motion block because it was blue, just like the jump block in Human Resource Machine.
when you jump, you basically move, which is called “Motion”

Do you have trouble with scratch slang? Check this awesome site out!

I'm a red panda btw
Mr_PenguinAlex
Scratcher
1000+ posts

jump block

LankyBox01 wrote:

Mr_PenguinAlex wrote:

scratchastroLOL wrote:

I think this probably belongs in Control rather than Motion…
i only made it a motion block because it was blue, just like the jump block in Human Resource Machine.
when you jump, you basically move, which is called “Motion”
it doesn't fit in the category of motion since it isn't actually moving the sprite

LankyBox01
Scratcher
1000+ posts

jump block

Mr_PenguinAlex wrote:

LankyBox01 wrote:

Mr_PenguinAlex wrote:

scratchastroLOL wrote:

I think this probably belongs in Control rather than Motion…
i only made it a motion block because it was blue, just like the jump block in Human Resource Machine.
when you jump, you basically move, which is called “Motion”
it doesn't fit in the category of motion since it isn't actually moving the sprite
lol i was playing a trick on you XD

Do you have trouble with scratch slang? Check this awesome site out!

I'm a red panda btw
LankyBox01
Scratcher
1000+ posts

jump block

Also, no support.
This isn't a .bat file, it's a .sb3 file
No advanced stuff.

Do you have trouble with scratch slang? Check this awesome site out!

I'm a red panda btw
fdreerf
Scratcher
1000+ posts

jump block

LankyBox01 wrote:

Also, no support.
This isn't a .bat file, it's a .sb3 file
No advanced stuff.
What?

Hyped for MS-DOS 11.0
Mr_PenguinAlex
Scratcher
1000+ posts

jump block

LankyBox01 wrote:

Also, no support.
This isn't a .bat file, it's a .sb3 file
No advanced stuff.
Say what?

LankyBox01
Scratcher
1000+ posts

jump block

fdreerf wrote:

LankyBox01 wrote:

Also, no support.
This isn't a .bat file, it's a .sb3 file
No advanced stuff.
What?

Mr_PenguinAlex wrote:

LankyBox01 wrote:

Also, no support.
This isn't a .bat file, it's a .sb3 file
No advanced stuff.
Say what?
Haven't you heard of the batch programming language?
In case you're living under a rock, it's some advanced programming in Command Prompt™

Do you have trouble with scratch slang? Check this awesome site out!

I'm a red panda btw
fdreerf
Scratcher
1000+ posts

jump block

LankyBox01 wrote:

Haven't you heard of the batch programming language?
In case you're living under a rock, it's some advanced programming in Command Prompt™
Please tell me how that is relevant to anything.

Hyped for MS-DOS 11.0
LankyBox01
Scratcher
1000+ posts

jump block

fdreerf wrote:

LankyBox01 wrote:

Haven't you heard of the batch programming language?
In case you're living under a rock, it's some advanced programming in Command Prompt™
Please tell me how that is relevant to anything.
“goto” is a feature that does the same thing as this so-called “Jump” block.

LankyBox01 wrote:

Also, no support.
This isn't a .bat file, it's a .sb3 file
No advanced stuff.

Do you have trouble with scratch slang? Check this awesome site out!

I'm a red panda btw
Mr_PenguinAlex
Scratcher
1000+ posts

jump block

LankyBox01 wrote:

“goto” is a feature that does the same thing as this so-called “Jump” block.

LankyBox01 wrote:

Also, no support.
This isn't a .bat file, it's a .sb3 file
No advanced stuff.
first of all
you say no support just because there is a similar feature in a completely different programming language??
also, going to a specific part of a script isn't advanced

Last edited by Mr_PenguinAlex (Aug. 7, 2020 02:51:46)


Xoffhia
Scratcher
500+ posts

jump block

Support!
Yep, without this block i'd have to spend lots of time figuring the workaround by the broadcast blocks.

“God promises to make something good out of the storms that bring devastation to your life.”- Romans 8:28

Heyo. My fav colour is blue.


I love Mint
choc chip ice cream.

I don't like pink.

I also love yellow.

Also, be moist




Maximouse
Scratcher
1000+ posts

jump block

NO SUPPORT.

Sorry for the big red text, but using jump/goto statements in any programming language is considered a bad practice. Instead you should use higher level control structures – in Scratch those are “repeat”, “repeat until”, custom blocks (with “stop this script” for exiting) and broadcasts. In my opinion Scratch should also add a “this loop” option to the stop block.


This is Maximouse's signature. Learn more about signatures.
HighFlyer222
Scratcher
100+ posts

jump block

oh yeah finally someone suggested the annoying goto
I agree with Maximouse here, once I wanted GOTO in Python for my first code, a command line calculator, and I wanted it to be like this:
when green flag clicked
::motion
ask [Please choose an operation (1:Addition 2:Substraction 3:Multiplication 4:Division)] and wait
if <not <<(answer)>(0)> or <(answer)<(5)>>> then
say [Invalid operation] for (2) secs
jump::motion
end

But then I discovered it was easily workaroundable with this, and it also avoid spaghetti code:
when green flag clicked
repeat until <<(answer)>(0)> or <(answer)<(5)>>
ask [Please choose an operation (1:Addition 2:Substraction 3:Multiplication 4:Division)] and wait
if <not <<(answer)>(0)> or <(answer)<(5)>>> then
say [Invalid operation] for (2) secs
end
end

Another reason to not support is, where will each jump block jump to? How will you remember that? Like this:
jump::motion
if <(0)>(1)> then
say [What?]
::motion
end
::motion
repeat until <(variable)=(8)>
jump::motion
change [variable v] by (1)
end

Can you understand what the code does?

This post in a nutshell:
No support

Last edited by HighFlyer222 (Aug. 7, 2020 08:41:30)


Suggestions forum is love, suggestions forum is life

Powered by DjangoBB