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

#1 2008-05-14 02:40:21

Zap6987
Scratcher
Registered: 2008-04-16
Posts: 1

Variables

How do you make variables appear by using broadcasting?

Offline

 

#2 2008-05-14 05:28:11

MyRedNeptune
Community Moderator
Registered: 2007-05-07
Posts: 1000+

Re: Variables

Sadly, there isn't such an option in Scratch.  sad  Although it would be great if it was.


http://i52.tinypic.com/5es7t0.png I know what you're thinking! "Neptune! Get rid of those filthy advertisements and give us back the Zarathustra siggy, you horrible person!" Well, don't worry about it, the Zara siggy will be back soon, new and improved! ^^ Meanwhile, just do what the sig tells you to. >.>

Offline

 

#3 2008-05-14 07:13:12

JSO
Community Moderator
Registered: 2007-06-23
Posts: 1000+

Re: Variables

The only way to do this at the moment is to create a sprite, and putting  it in front of the variable's box. You can show/hide this sprite to "show/hide" the variable...


http://oi48.tinypic.com/2v1q0e9.jpg

Offline

 

#4 2008-05-14 13:00:52

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: Variables

Or, create a sprite (or sprites) to show the digits of the variable, instead of using the standard variable display box.  You can then show/hide this as required.


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#5 2008-05-14 14:13:30

JSO
Community Moderator
Registered: 2007-06-23
Posts: 1000+

Re: Variables

I used the method Mayhem described too.

one thing is, that you have to be careful with "gotofront" because  often objects come in front of the digits. Not recommended when you are creating a scroller game.

The good thing is that it is possible to stamp text on the screen. check out my project "3D-Pong" to see what I mean.

joren


http://oi48.tinypic.com/2v1q0e9.jpg

Offline

 

#6 2008-07-16 00:20:07

prasannab
Scratcher
Registered: 2008-05-06
Posts: 2

Re: Variables

How can I use variable with goto x: ? I tried it is not taking the variable name i created with
make new variable .

Offline

 

#7 2008-07-16 01:08:04

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: Variables

Hi prasannab. Sounds like you created a variable and then tried to write its name into the numerical argument field of the movement blocks. Instead what you want to try is dragging the round variable block (a 'reporter' block) and dropping it into one of the fields of the target block  smile


Jens Mönig

Offline

 

#8 2008-07-16 01:40:57

Kingdaro
Scratcher
Registered: 2008-06-08
Posts: 100+

Re: Variables

Zap6987 wrote:

How do you make variables appear by using broadcasting?

Heres a way:
[blocks]
Make a sprite that blends in with the background and is big enough to cover the variable.
<when green flag clicked>
<show>
<end script>
<when I receive[ go game (or whatever) either:
<set[ ghost ]effect to( 100
OR
<hide>
That way the variable will show.
[/blocks]

Offline

 

Board footer