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

#1 2011-03-22 13:35:17

mrchaoslama
New Scratcher
Registered: 2011-03-18
Posts: 1

Maximum And minimum values for variables

I am finding it hard to find out how to make variable values to never go above
50 or below 0 so i would find it very helpful if in scratch 2.0 to be able to do this but this is just one suggestion of extra helpful thing that could be improved in scratch

if this is possible in Scratch 1.4 please please please show me how to because that would be very helpful for my scratch project i have been working on for a while now...




GOodbAi and remember... IM A NINJA!!!

Offline

 

#2 2011-03-22 14:39:26

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Maximum And minimum values for variables

You can do this easily with the scratch blocks

if variable > 50
set variable to 50

if variable <0
set variable to 0


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#3 2011-03-22 16:11:10

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Maximum And minimum values for variables

Yes, archmage pretty much summed it up - it's already quite possible with blocks already.  smile  If Scratch were to spoonfeed us the answers to everything, well, then we wouldn't learn anything, would we?

Offline

 

#4 2011-03-27 14:45:08

Rexpup
Scratcher
Registered: 2010-10-17
Posts: 100+

Re: Maximum And minimum values for variables

Right click on the variable when it's a slider, then press "set slider min and max".


http://i.imgur.com/QQH4J.gif

Offline

 

Board footer