This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2013-02-20 19:42:34

dankegel
New Scratcher
Registered: 2013-02-20
Posts: 2

Can't set x to a variable

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

 

#2 2013-02-20 19:50:17

piguillaud
Scratcher
Registered: 2010-06-19
Posts: 100+

Re: Can't set x to a variable

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

 

#3 2013-02-20 20:10:38

CAA14
Scratcher
Registered: 2013-01-14
Posts: 1000+

Re: Can't set x to a variable

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,  smile

Offline

 

#4 2013-02-21 00:09:26

dankegel
New Scratcher
Registered: 2013-02-20
Posts: 2

Re: Can't set x to a variable

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

 

#5 2013-02-21 05:02:27

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Can't set x to a variable

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.  smile


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

Board footer