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

#1 2012-04-20 05:22:46

Annabeth4ever29
New Scratcher
Registered: 2012-04-20
Posts: 2

Help! Problem with size scripts

In my project, I want to change the size of things every time there is a level up. I know it sound simple, but I can't get the growing to stop. I just want it to grow by 10, then stop. Any ideas? Thank you

Offline

 

#2 2012-04-20 06:00:55

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Help! Problem with size scripts

Try this, Annabeth4vever29:

when I receive [level up v]
repeat (10)
change size by (1)
end
If you wanted it to grow instantly you could get rid of the repeat loop and just put "10" into the "change size by( )" block!

Unless you are having trouble because it just keeps growing?


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#3 2012-04-20 07:51:18

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Help! Problem with size scripts

You could do something quite complex like this:

when gf clicked
forever
  change size by ((((90)+((level)*(10)))-(size))/(10))
This allows to avoid broadcasts and have a "smoothing" effect as it changes size  smile


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#4 2012-04-20 14:56:30

Annabeth4ever29
New Scratcher
Registered: 2012-04-20
Posts: 2

Re: Help! Problem with size scripts

Thank you, but the growing still keeps growing. Any ideas?

Offline

 

#5 2012-04-20 18:39:04

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Help! Problem with size scripts

If you tried sparks' script (sorry AtomicBawm3, I'm too lazy to look at yours  tongue ) and it still keeps growing, the problem is probably elsewhere.  Do you change the sprite's size in any other script?  Do you broadcast "level up" more often than you intended?  Either of these could be causing the bug.


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#6 2012-05-06 16:54:57

berberberber
Scratcher
Registered: 2012-03-08
Posts: 1000+

Re: Help! Problem with size scripts

It could be that your doing this:

forever
broadcast [level up v]


http://i47.tinypic.com/2iaa73k.png

Offline

 

#7 2012-05-06 17:28:34

ManaUser
Scratcher
Registered: 2009-03-11
Posts: 100+

Re: Help! Problem with size scripts

Did you remember to reset the size back to normal when they restart?


http://i.imgur.com/SPYSM.gif http://i.imgur.com/t9k1Z.gif http://i.imgur.com/OwYVa.gif http://i.imgur.com/0qlZq.gif

Offline

 

Board footer