Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Modes
- juicykiwi
- Scratcher
86 posts
Modes
I making a random art maker where when you start it switches to a random mode. Then you can toggle the modes using the 1 and 2 keys. Somehow, it doesn't switch modes, and I don't know what's wrong. Help!
Link: http://scratch.mit.edu/projects/19330314/#player
Thanks!
Link: http://scratch.mit.edu/projects/19330314/#player
Thanks!
I <3 clarinet!
pen down
- drmcw
- Scratcher
1000+ posts
Modes
Your custom blocks contain forever loops and so never finish which means they will never return to the script which called them, so no mode change!
- CodeLegend
- Scratcher
500+ posts
Modes
The mode variable is changing, but a script with a forever in it is already running. The [Mode 1] and [Mode 2] blocks don't ever end because their last block is a forever.
You could do this instead:
You could do this instead:
when [1 v] key pressed
stop [other scripts in sprite v]
Mode 1 //category=custom
- JAVAProgramming
- Scratcher
100+ posts
Modes
Why do you have a modes variable if you aren't using it?
My Newest Project, Come Check It Out
Dots, On Scratch
Want to change the way we count? The Dozenal System.
“The story so far:
In the beginning the Universe was created.
This has made a lot of people very angry and been widely regarded as a bad move.”
― Douglas Adams, The Restaurant at the End of the Universe
- JAVAProgramming
- Scratcher
100+ posts
Modes
Can't put the “stop…” block before the end of a script. The mode variable is changing, but a script with a forever in it is already running. The [Mode 1] and [Mode 2] blocks don't ever end because their last block is a forever.
You could do this instead:when [1 v] key pressed
stop [other scripts in sprite v]
Mode 1 //category=custom
My Newest Project, Come Check It Out
Dots, On Scratch
Want to change the way we count? The Dozenal System.
“The story so far:
In the beginning the Universe was created.
This has made a lot of people very angry and been widely regarded as a bad move.”
― Douglas Adams, The Restaurant at the End of the Universe
- scubajerry
- Scratcher
1000+ posts
Modes
You can put THIS stop block anywhere. You are right about the other two types of STOP blocks.Can't put the “stop…” block before the end of a script. The mode variable is changing, but a script with a forever in it is already running. The [Mode 1] and [Mode 2] blocks don't ever end because their last block is a forever.
You could do this instead:when [1 v] key pressed
stop [other scripts in sprite v]
Mode 1 //category=custom
- JAVAProgramming
- Scratcher
100+ posts
Modes
Ohh, I didn't realise that it changed shapeYou can put THIS stop block anywhere. You are right about the other two types of STOP blocks.Can't put the “stop…” block before the end of a script. The mode variable is changing, but a script with a forever in it is already running. The [Mode 1] and [Mode 2] blocks don't ever end because their last block is a forever.
You could do this instead:when [1 v] key pressed
stop [other scripts in sprite v]
Mode 1 //category=custom
My Newest Project, Come Check It Out
Dots, On Scratch
Want to change the way we count? The Dozenal System.
“The story so far:
In the beginning the Universe was created.
This has made a lot of people very angry and been widely regarded as a bad move.”
― Douglas Adams, The Restaurant at the End of the Universe
- CodeLegend
- Scratcher
500+ posts
Modes
Yep! It's very useful when you have 1-sprite projects and you want to ‘start over’ without clicking the flag. Kind of like what this is doing! Plus the [Mode x] custom block never stops, so pressing the button of the mode that's already running won't do anything.Ohh, I didn't realise that it changed shapeYou can put THIS stop block anywhere. You are right about the other two types of STOP blocks. Can't put the “stop…” block before the end of a script.
- scubajerry
- Scratcher
1000+ posts
Modes
Your MODE BLOCKS have FOREVER loops in them, which means they will never return to the WHEN KEY PRESSED script to allow the STOP block to be executed. You can reverse the STOP and the MODE blocks and everything works fine.
Last edited by scubajerry (March 17, 2014 06:15:03)
- disnottaken
- Scratcher
26 posts
Modes
when green flag clicked
stop [ other scripts in sprite]
go to [ next] mode
- SpectrumPenguin
- New to Scratch
44 posts
Modes
We love the modes, it has:
Normal
Caturday
90s
Old timey
Prehistoric
Normal
Caturday
90s
Old timey
Prehistoric
- 1492864
- Scratcher
500+ posts
Modes
We love the modes, it has:
Normal
Caturday
90s
Old timey
Prehistoric
Please don't spam or necropost.
Scratcheth f'rum us'r | 1 year on Scratcheth | 750+ posts| Inching to 1000 posts, 1 posteth at a timeth
Mine own most did view projecteth | Mine own most did love and fav'd projecteth | Latest projecteth |
Highlight h're and shift+down to readeth the rest.
The most did suggest suggestion:
Dark mode
- k0d3rrr
- Scratcher
1000+ posts
Modes
these modes are very cool for me.
Please don't spam or necropost.
k0d3rrr
3 forum tips for experienced forumers (in no particular order):
- If you are reporting a new forumer's topic to be closed, or moved to another forum, don't mention it, because then, the topic creator will think they will receive either an alert or a block.
- New forumers won't immediately know the rules or terminology of the forums. I have seen this happen hundreds of times (exaggeratedly), especially when experienced forumers (I won't name any) tell new forumers that they are "necroposting", which is when someone posts on an old and resolved topic (especially in the Questions about Scratch forum), causing said topic to be moved to the front page of that forum.
- Using Scratchblocks as a writing style is not blockspam, unless it is not relevant to the discussion. For example, this
is not blockspam, but these How do I make a smooth gliding animation?when green flag clicked
repeat until <(my question) = [answered]>
ask [How do I make a smooth gliding animation?] and wait
end
say [Thank you!]when green flag clicked
move (58) steps
play sound [Stock Laughter Sound Effect HD - 1 Hour v]
forever
play sound [Stock Screaming Sound Effect HD - 1 Hour v]
switch backdrop to [internet v]
say [i broke the internet] for (2) secs
turn cw (15) degrees
go to [nearby restaurant v]
next costume
end
are blockspam, and must be reported.when green flag clicked
repeat until <(out of dorito's) = [true]>
broadcast [eat dorito chip v]
end
say [IM OUT OF DORITO'S!!!!!!!!! :(]
play sound [Scream2 v] until done
forever
turn cw (120) degrees
play sound [Scream2 v]
play sound [we have no dorito's sorry v]
end
- Discussion Forums
- » Help with Scripts
- » Modes