decrease the size of the object

readerboy7

  • Posts: 59
i need to make a behavior: if [something happens] multiply width and height of object and collision by 0.90

Sunflower

  • Posts: 591
if <something happens>
  grow [Self] to (w: [90] %, h: [90] %) over [ 0 ] secs using [None]

"grow" block can be found in Actor >> Tweening.
Is it what you meant? ^^

« Last Edit: September 17, 2011, 03:41:56 am by Sunflower »

readerboy7

  • Posts: 59
yes that is what i meant except that when it happens it only happens once and that section of the behavior can't be re-activated. any ideas on how to fix that?

coleislazy

  • *
  • Posts: 2607
Use messaging instead. Put a "when this hears ___" block in your scene and put the grow block in it. Then, whenever you want it to execute that code, use the "tell this to ___". Just make sure you use the same name in both blocks. You can also have the scene or other actors call this function by using the other messaging blocks.

readerboy7

  • Posts: 59
the behavior still only works once.

gigaclon

  • Posts: 163
its working, except it isn't doing anything the percentage is based on the normal size so you aren't doing anything. Maybe if you put the current size (start at 1) as a attribute then you can multiply it by .9 then do the grow