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

#1 2012-11-30 10:44:47

AmitDigga
New Scratcher
Registered: 2011-04-21
Posts: 18

Variable Subscript (division)

scratch supports variable for this sprite only...
when making a variable it should ask same or different for all
VARIABLE WHICH IS DIFFERENT FOR ALL
now if make a variable (say) Mass and check this option then
it assumes that it is different for all sprites

now i make another variable Acceleration = 50/Mass

[this { } indicate the thing which is written in sub script]
suppose now i select sprite Ball

<Set MASS {Ball} (50)>
->duplicate  sprite->ball 2 or say any other sprite house, TV,


<Set MASS {bla bla bla} (60)>
now using it in both sprite or as many sprites

<change y by acceleration>
acceleration will be different in both..

This is just to reduce work by making main variable which automaticaaly distribute itself where ever required..i m not talking about this particular case only...but when i have many similar sprite and many variables like speed x ,speed y ,accelerationx,y  ,etc etc ...it becomes really time consuming and complex to handle all things correctly....

Offline

 

Board footer