Discuss Scratch

likegames
Scratcher
11 posts

Universal Procedures (ALL SPRITES)

I think it would be very helpful, and much appreciated to have the ability to make procedures which can be accessed by every sprite. You could make it so that it works like a variable, where you have the option to select if it is global or not as you create it (or edit it as well, in this case). You could also make it so that procedures defined in the stage are global. Thanks for reading.

tl;dr: Custom blocks that you can run on every sprite.

Last edited by likegames (Sept. 13, 2013 18:04:16)

Lilifant7253
Scratcher
1000+ posts

Universal Procedures (ALL SPRITES)

+1 Support!
likegames
Scratcher
11 posts

Universal Procedures (ALL SPRITES)

No-one else?
likegames
Scratcher
11 posts

Universal Procedures (ALL SPRITES)

bump
iTweak0r
Scratcher
100+ posts

Universal Procedures (ALL SPRITES)

support
BobStanley
Scratcher
100+ posts

Universal Procedures (ALL SPRITES)

like for what use?
likegames
Scratcher
11 posts

Universal Procedures (ALL SPRITES)

For the use that functions are used in programming. DRY/Don't Repeat Yourself is a key part of simplifying programming, to cut out half the effort. It involves using functions to combine similar chunks of code, e.g.

if a=5 then
say “Yay!”
/

if a=1 then
say “No!”
/

You could just do

define aexamine str num
if a=num then
say num
/

aexamine Yay! 5

aexamine No! 1

However if these two scripts are both in different sprites, you can't use the same block without copying over the definition, which ruins the concept of “DRY”.

Last edited by likegames (Sept. 13, 2013 21:47:14)

likegames
Scratcher
11 posts

Universal Procedures (ALL SPRITES)

bump
likegames
Scratcher
11 posts

Universal Procedures (ALL SPRITES)

bumpity?
A-no-meep
Scratcher
100+ posts

Universal Procedures (ALL SPRITES)

I like this idea.

Powered by DjangoBB