Discuss Scratch

theonlygusti
Scratcher
1000+ posts

Best block idea! Organise code [CODE SECTIONS]

ChocolatePi wrote:

workaround:

if <[1] = [1]> then // gameplay

repeat until <gameover>
i don't want to write all that in Scratchblocks :: motion
problem? :: variables
end

end
You're right, you could do that, but it's not collapsible, comments don't stay where you put them (if they're attached) and it just looks ugly and unorganised.

The whole point of my idea is to make it more organised and less hectic.
Tropic
Scratcher
1000+ posts

Best block idea! Organise code [CODE SECTIONS]

ChocolatePi wrote:

workaround:

if <[1] = [1]> then // gameplay

repeat until <gameover>
i don't want to write all that in Scratchblocks :: motion
problem? :: variables
end

end
Well, that might work if you make it like this:
if <[gameplay] = [gameplay]> then
put scripts here :: grey
end
However, I still think that this should be implemented since the workarounds aren't that good. It still might be hard to find all if statements and you might confuse them with other scripts.
Tropic
Scratcher
1000+ posts

Best block idea! Organise code [CODE SECTIONS]

ChocolatePi wrote:

workaround:

if <[1] = [1]> then // gameplay

repeat until <gameover>
i don't want to write all that in Scratchblocks :: motion
problem? :: variables
end

end
But you can't “collapse” the scripts using if statements

EDIT: I was going to put this in the other post I wrote but I thought it got deleted first so I wrote it in another post instead. However, it seems that my first post never got deleted.

EDIT 2: @theonlygusti also wrote about this apparently

Last edited by Tropic (Oct. 7, 2014 20:07:14)

peppermintpatty5
Scratcher
1000+ posts

Best block idea! Organise code [CODE SECTIONS]

Oh my gosh yes! SUPPORT
OmnipotentPotato
Scratcher
1000+ posts

Best block idea! Organise code [CODE SECTIONS]

Tropic wrote:

MegaApuTurkUltra wrote:

Tropic wrote:

Evil Kumquat wrote:

OmnipotentPotato wrote:

MegaApuTurkUltra wrote:

djdolphin wrote:

theonlygusti wrote:

djdolphin wrote:

Can't you just use comments to label the 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.
I'd prefer inline, multiline comments (like the old comment block) that could wrap around scripts, instead of a dedicated section block.
Why are you quoting the posts?
When you post only a quote of someone it means they said exactly what you want to say. Basically, it means you completely agree and no other text is necessary.
Ah, ok
The real question is how that Evil Kumquat thing got in there. :O
Tropic
Scratcher
1000+ posts

Best block idea! Organise code [CODE SECTIONS]

OmnipotentPotato wrote:

Tropic wrote:

MegaApuTurkUltra wrote:

Tropic wrote:

Evil Kumquat wrote:

OmnipotentPotato wrote:

MegaApuTurkUltra wrote:

djdolphin wrote:

theonlygusti wrote:

djdolphin wrote:

Can't you just use comments to label the 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.
I'd prefer inline, multiline comments (like the old comment block) that could wrap around scripts, instead of a dedicated section block.
Why are you quoting the posts?
When you post only a quote of someone it means they said exactly what you want to say. Basically, it means you completely agree and no other text is necessary.
Ah, ok
The real question is how that Evil Kumquat thing got in there. :O
RPFluffy
Scratcher
1000+ posts

Best block idea! Organise code [CODE SECTIONS]

You mean kinda like a class in programming, if so YEAH I support!!

But the comment thing why not this?

define comment (text)
//does nothing..

Last edited by RPFluffy (Oct. 10, 2014 22:17:54)

theonlygusti
Scratcher
1000+ posts

Best block idea! Organise code [CODE SECTIONS]

RPFluffy wrote:

You mean kinda like a class in programming, if so YEAH I support!!

But the comment thing why not this?

define comment (text)
//does nothing..
Why is it like a class?

It's just meant to better organise the scripts area.
mitopolis
Scratcher
100+ posts

Best block idea! Organise code [CODE SECTIONS]

sssssssssssssssssssssssssssssuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuupppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp-ppppppppppppppppppppppppppppppppppppppppppppppppppppppooooooooooooooooooooooooooooooooooooooooooooooooooooorrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrtttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt
Tropic
Scratcher
1000+ posts

Best block idea! Organise code [CODE SECTIONS]

RPFluffy wrote:

You mean kinda like a class in programming, if so YEAH I support!!

But the comment thing why not this?

define comment (text)
//does nothing..
Not the classes in programming, but the organising (in programming you can usually organise things easily using something that reminds of this idea)

Last edited by Tropic (Oct. 11, 2014 10:31:14)

RED-drag0n
Scratcher
79 posts

Best block idea! Organise code [CODE SECTIONS]

theonlygusti wrote:

I would love to have the ability to sanction my code into different sections. This would make it so much easierto 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:

[name-of-section] ▼:: grey 

[name-of-section] ▲ :: grey cstart

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.

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] ▲ :: grey cstart
set [xv v] to [0]
set [yv v] to [0]
goto x: (0) y: (-100) ::motion
show
end
[gameplay] ▼:: grey
[gameover] ▲ :: grey cstart
play sound [deathnoise v] until done
end

As they contain collapsible sections, the above, by clicking on the arrow, could become:

when green flag clicked
[setup] ▲ :: grey cstart
set [xv v] to [0]
set [yv v] to [0]
goto x: (0) y: (-100) ::motion
show
end
[gameplay] ▲ :: grey cstart
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
end
[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 cstart
[comment] ▲ :: grey cstart

So the blocks don't really do anything, they just make it easier to debug?
RED-drag0n
Scratcher
79 posts

Best block idea! Organise code [CODE SECTIONS]

Tropic wrote:

OmnipotentPotato wrote:

Tropic wrote:

MegaApuTurkUltra wrote:

Tropic wrote:

Evil Kumquat wrote:

OmnipotentPotato wrote:

MegaApuTurkUltra wrote:

djdolphin wrote:

theonlygusti wrote:

djdolphin wrote:

Can't you just use comments to label the 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.
I'd prefer inline, multiline comments (like the old comment block) that could wrap around scripts, instead of a dedicated section block.
Why are you quoting the posts?
When you post only a quote of someone it means they said exactly what you want to say. Basically, it means you completely agree and no other text is necessary.
Ah, ok
The real question is how that Evil Kumquat thing got in there. :O

:0
Tropic
Scratcher
1000+ posts

Best block idea! Organise code [CODE SECTIONS]

RED-drag0n wrote:

theonlygusti wrote:

I would love to have the ability to sanction my code into different sections. This would make it so much easierto 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:

[name-of-section] ▼:: grey 

[name-of-section] ▲ :: grey cstart

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.

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] ▲ :: grey cstart
set [xv v] to [0]
set [yv v] to [0]
goto x: (0) y: (-100) ::motion
show
end
[gameplay] ▼:: grey
[gameover] ▲ :: grey cstart
play sound [deathnoise v] until done
end

As they contain collapsible sections, the above, by clicking on the arrow, could become:

when green flag clicked
[setup] ▲ :: grey cstart
set [xv v] to [0]
set [yv v] to [0]
goto x: (0) y: (-100) ::motion
show
end
[gameplay] ▲ :: grey cstart
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
end
[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 cstart
[comment] ▲ :: grey cstart

So the blocks don't really do anything, they just make it easier to debug?
Kind of, they make it easier to organise the scripts
OmnipotentPotato
Scratcher
1000+ posts

Best block idea! Organise code [CODE SECTIONS]

Don't quote the entire OP please.
goldfish678
Scratcher
1000+ posts

Best block idea! Organise code [CODE SECTIONS]

Support.
Cyoce
Scratcher
500+ posts

Best block idea! Organise code [CODE SECTIONS]

support :: operators stack
theonlygusti
Scratcher
1000+ posts

Best block idea! Organise code [CODE SECTIONS]

OmnipotentPotato wrote:

Don't quote the entire OP please.
theonlygusti
Scratcher
1000+ posts

Best block idea! Organise code [CODE SECTIONS]

Bump
hppavilion
Scratcher
100+ posts

Best block idea! Organise code [CODE SECTIONS]

So like a revamped version of the old comment block…
I like it.
Support.
theonlygusti
Scratcher
1000+ posts

Best block idea! Organise code [CODE SECTIONS]

hppavilion wrote:

So like a revamped version of the old comment block…
I like it.
Support.
Not really. This allows you to organize your code and separate sections, the old comment block didn't. Also, this one will be a right-click option, to avoid the ambiguity associated with the comment block (“Does it do anything?”)

Powered by DjangoBB