Discuss Scratch
- Discussion Forums
- » Suggestions
- » Best block idea! Organise code [CODE SECTIONS]
- theonlygusti
-
1000+ posts
Best block idea! Organise code [CODE SECTIONS]
I would love to have the ability to sanction my code into different sections. This would make it so much easier to use, edit and debug my projects, and I'm sure others will feel the same way.
It would be brilliant if we could see a c-block that allows us to add this function, my concept looks like:
The arrows let your code become collapsible chunks, so that extremely large scripts can suddenly become much easier to manage. You can use the text area to name your section whatever you want.
Also, these blocks shouldn't be in the block palette, as that might confuse new scratchers. I suggest distinguishing them from current blocks, maybe by rounding corners entirely, and having the as a right click option, like comments.
It would make projects so much nicer and easier to organise, which in turn makes projects easier to learn from.
Learning from other projects is one of the key concepts of Scratch!
This block will make that easier to accomplish.
You could turn a mess of stuff into something nice to view and debug,
As they contain collapsible sections, the above, by clicking on the arrow, could become:
Please let me know what you think of my idea. If you want to include the custom blocks in your post then, using scratch blocks plugin, it looks like
and
It would be brilliant if we could see a c-block that allows us to add this function, my concept looks like:
[name-of-section] ▼:: grey
[name-of-section] ▲ {
} :: grey
The arrows let your code become collapsible chunks, so that extremely large scripts can suddenly become much easier to manage. You can use the text area to name your section whatever you want.
Also, these blocks shouldn't be in the block palette, as that might confuse new scratchers. I suggest distinguishing them from current blocks, maybe by rounding corners entirely, and having the as a right click option, like comments.
It would make projects so much nicer and easier to organise, which in turn makes projects easier to learn from.
Learning from other projects is one of the key concepts of Scratch!
This block will make that easier to accomplish.
You could turn a mess of stuff into something nice to view and debug,
when green flag clicked
[setup] ▲ {
set [xv v] to [0]
set [yv v] to [0]
goto x: (0) y: (-100) ::motion
show
} :: grey
[gameplay] ▼:: grey
[gameover] ▲ {
play sound [deathnoise v] until done
} :: grey
As they contain collapsible sections, the above, by clicking on the arrow, could become:
when green flag clicked
[setup] ▲ {
set [xv v] to [0]
set [yv v] to [0]
goto x: (0) y: (-100) ::motion
show
} :: grey
[gameplay] ▲ {
repeat until <gameover ::operators boolean>
if <key [a v] pressed?> then
change [xv v] by [-1]
end
if <key [d v] pressed?> then
change [xv v] by [1]
end
if <key [w v] pressed?> then
change [yv v] by [1]
end
end
} :: grey
[gameover] ▼:: grey
Please let me know what you think of my idea. If you want to include the custom blocks in your post then, using scratch blocks plugin, it looks like
[comment] ▼ :: grey
[comment] ▼ :: grey
and
[comment] ▲ {
} :: grey
[comment] ▲ {
} :: grey
Last edited by theonlygusti (Aug. 31, 2016 21:00:27)
- GyroscopeBill
-
500+ posts
Best block idea! Organise code [CODE SECTIONS]
It's cool. It's a lot neater than the comments we have at the moment.
- AonymousGuy
-
1000+ posts
Best block idea! Organise code [CODE SECTIONS]
Those aren't really comments…
- theonlygusti
-
1000+ posts
Best block idea! Organise code [CODE SECTIONS]
I know, I will re-title it if you can think of a name, it's just that this is the one I came up with. Those aren't really comments…
- djdolphin
-
1000+ posts
Best block idea! Organise code [CODE SECTIONS]
Can't you just use comments to label the sections?
- AonymousGuy
-
1000+ posts
Best block idea! Organise code [CODE SECTIONS]
There is technically a workaround (put all the scripts in custom blocks) but I still think it would be useful.
Support.
Support.
- Blueinkproductions
-
1000+ posts
Best block idea! Organise code [CODE SECTIONS]
There is technically a workaround (put all the scripts in custom blocks) but I still think it would be useful.Technically
Support.
Anyway, support.
- Firedrake969
-
1000+ posts
Best block idea! Organise code [CODE SECTIONS]
Technically a workaround, yeah, but I support.
(I think this is the first time I've supported a workaroundable thing
)
(I think this is the first time I've supported a workaroundable thing

- turkey3
-
1000+ posts
Best block idea! Organise code [CODE SECTIONS]
I support, because attached comments can get messy. And the drop-downs can make code very clean,
Last edited by turkey3 (July 29, 2014 23:56:31)
- theonlygusti
-
1000+ posts
Best block idea! Organise code [CODE SECTIONS]
Some of you have said how there is technically a work-around, although there might be, it would still leave projects quite messy with all the
define sectionjust lying around.
- theonlygusti
-
1000+ posts
Best block idea! Organise code [CODE SECTIONS]
Yes, but current Scratch comments are the ugliest things. This block would make everything neater. Even just a comment block would make everything neater. Can't you just use comments to label the sections?
- Blaze349
-
1000+ posts
Best block idea! Organise code [CODE SECTIONS]
I support, because attached comments can get messy. And the drop-downs can make code very clean,
- djdolphin
-
1000+ posts
Best block idea! Organise code [CODE SECTIONS]
I'd prefer inline, multiline comments (like the old comment block) that could wrap around scripts, instead of a dedicated section block.Yes, but current Scratch comments are the ugliest things. This block would make everything neater. Even just a comment block would make everything neater. Can't you just use comments to label the sections?
- theonlygusti
-
1000+ posts
Best block idea! Organise code [CODE SECTIONS]
Yes, that was actually my first idea. I do like the idea of collapsible c-blocks though, we could just multi-line the title section so that it can be used as a comment 

- theonlygusti
-
1000+ posts
Best block idea! Organise code [CODE SECTIONS]
How about also re-adding the old comment block? That is neater than the current comments (if it was added, I would actually start using comments):
These new blocks could maybe have their own palette, called comments or organise, or something like that. They could also appear under the More Blocks palette.
These new blocks could maybe have their own palette, called comments or organise, or something like that. They could also appear under the More Blocks palette.
comment > :: grey
comment v :: grey
[multi-lineable area] :: grey
section: [title] :: grey cstart
- superninja109
-
25 posts
Best block idea! Organise code [CODE SECTIONS]
support when I want to bugfix the game that I have a link to in my sig, It is like going through a jungle of scripts because some of the are even on top of each other.
- Blueinkproductions
-
1000+ posts
Best block idea! Organise code [CODE SECTIONS]
Right-click->clean up can help. support when I want to bugfix the game that I have a link to in my sig, It is like going through a jungle of scripts because some of the are even on top of each other.
- Discussion Forums
- » Suggestions
-
» Best block idea! Organise code [CODE SECTIONS]