I'm a graybeard programmer introducing my 9-year-old to programming.
I'd like to write a little platform scroller, or something, and see fine examples like
http://en.wikibooks.org/wiki/Scratch/Lessons/Movement
for how to do velocity and movement. Only... in the scratch 1.4 gui,
although I can create a sprite and move it around programmatically,
and can create a variable and set it, I can't set X to the value of a variable.
The 'set x to' block does let you type stuff into the entry field, but only digits;
it doesn't let you type a variable name in.
I can only suppress my anti-gui-rage for so long. Help me before I explode :-)
Offline
Thats weird! Set x can be set to a variable... The space to enter the number is round, so is the variable. Try again dragging the variable in the space?
Offline
dankegel wrote:
I'm a graybeard programmer introducing my 9-year-old to programming.
I'd like to write a little platform scroller, or something, and see fine examples like
http://en.wikibooks.org/wiki/Scratch/Lessons/Movement
for how to do velocity and movement. Only... in the scratch 1.4 gui,
although I can create a sprite and move it around programmatically,
and can create a variable and set it, I can't set X to the value of a variable.
The 'set x to' block does let you type stuff into the entry field, but only digits;
it doesn't let you type a variable name in.
I can only suppress my anti-gui-rage for so long. Help me before I explode :-)
Yes, what piguillaud said should work. When you say "x", are you talking about is x position or just a variable named x?
Regards,
CAA14
P.S. I love the notion that your teaching your child programming! That's so cool,
Offline
piguillaud wrote:
Thats weird! Set x can be set to a variable... The space to enter the number is round, so is the variable. Try again dragging the variable in the space?
What is this "again" of which you speak? I would never in a million years have thought of dragging the variable to a text entry field. Thanks for the tip, it works.
<flame>
Now, where do I file an enhancement request to let you *type* the *' variable name in the text entry box? Or is that against the Scratch philosophy? I'm surprised they let you type digits in, and that they don't have a scrolling list of all possible numbers to drag in.
</flame>
Offline
Typing a variable name in is in fact against the "philosophy" of Scratch, which (though it varies greatly), to me is that shouldn't need to think about the language; you should interact directly with your application/game/animation. In other words, I should be spending more time thinking about how I can make my animation better, than thinking about how to implement that.
What that means is that programming should be no-sweat intuitive. Typing a name into a text box may be intuitive to a 10-year-experienced C dev or whatever, but to a casual 10-year-old (which I was not too long ago!), it makes more sense that whenever I want to get the value of a variable, I would look for a block that returns it. Remember, Scratch programmers have likely had NO programming experience before—to them, the concept of even a loop may be a bit hard-to-understand at first. The point is that though Scratch aims to teach programming, it also aims to make it as easy to understand as possible.
Offline