Discuss Scratch

Skelewar
New to Scratch
4 posts

Aren't Procedures wasted if they aren't global?

I'm new to Scratch. As I understand it, procedures are local to sprites… ie, each sprite needs its own definition block. Doesn't this kill the power of procedures (methods, functions)?

I need to be able to define a procedure in a global location and have the custom blocks be available to any sprite in the project. Without this, I find myself repeating endless blocks of code from sprite to sprite. If I change my mind, I need to go through 60 sprites and edit them all.

This seems like such an obvious need that I must be missing it. Any help?
scimonster
Scratcher
1000+ posts

Aren't Procedures wasted if they aren't global?

I don't know… it's something about it potentially being confusing to new users.
I do want global procedures too.

Retired Community Moderator
BTW, i run Google Chrome 41.0.2272.101 on a Linux system - Ubuntu 14.04. NEW: iPad 4th gen. w/retina.

418 I'm a teapot (original - to be read by bored computer geeks)
THE GAME (you just lost)
; THE SEMICOLON LIVES ON IN OUR SIGS
jchunter
New to Scratch
17 posts

Aren't Procedures wasted if they aren't global?

I also found the lack of subroutines and functions to be strange.

It is possible to write centralized programs in the “Stage” which can send and receive text “Messages” to/from the sprites. This provides a central point of control. Sprites can do the same with each other. However, I don't see a way to pass arguments easily…

I would like to hear from some of the more experienced scratchers about this subject.
scubajerry
Scratcher
1000+ posts

Aren't Procedures wasted if they aren't global?

I use them to help document my project. For example in here http://scratch.mit.edu/projects/12969047/#editor
ErnieParke
Scratcher
1000+ posts

Aren't Procedures wasted if they aren't global?

The reason why global custom blocks aren't in Scratch is because it can cause several problems. What if the custom block involved editing a local variable named (lives), but every other sprite didn't have it? What would you do then? The same situation would arise if you copied the block over to another project; how are you going to resolve the conflicts? Also, what if there was a local custom block already in the project?

Along with that, sprite's have a lot more capabilities then the stage, like moving. If a custom block could included a block, then it can't be used in the stage anymore, and so it's not global.

I know that there was some other sort of argument, but I've forgotten it by now. Hopefully I've shed a bit of light on this topic though.

Sharing,

ErnieParke

P.S. In reply to your topic's title, I don't find it a waste at all. The custom blocks I use are intended only for their sprite, and so I'm fine.

Last edited by ErnieParke (Nov. 13, 2013 02:48:34)


Powered by DjangoBB