It occurred to me that the simplest solution to a class of problems related to functions and the like is to allow the user to create their own little block. You could have a place (equivalent to the stage's script area) to create a set of scripts, each of which has a "hat" which gives its name and optionally 1 or 2 local variables to be filled. So, the hat would say something like "Start _____ with ______ and _______". To match your model, you may have three variants of that hat (with name only, name+arg, name+2args). Once created, these could be added to the "control" pool or a new pool (with a new color). Each would have the shape of a variable/number (so a function). The names of the "function" and arguments could be descriptive. So, a block may look like: "Bounce (gravity is [0], acceleration is [0])" where the hat looked like "Start _Bounce_ with _gravity_ and _acceleration_". The only other addition would be a control block which says something like "Do []" (you could drop it into wait and return 0, but that is counter-intuitive), when they do not need a return value. You could/should also make them exportable and importable.
The three big advantages of this are: easy to understand the basics of it (follows your model), a user can just use blocks they get from others, easy to learn functional concepts. Obviously I am assuming these functions act within the context of the sprite they are called by.
Thoughts?
Last edited by pkimelma (2007-04-12 12:14:16)
Offline
I think that you will be thrilled to be introduced with Jens' BYOB:
http://www.chirp.scratchr.org/blog/?p=19
Offline