Maths?

ShineyGamesShineyGames Member Posts: 157
edited November -1 in Working with GS (Mac)
I would like to make an actor twice as big or twice as small
I know I can do this lots of ways but this is a question about the maths not working and what I'm doing wrong
actor is 100

interpolate self.hight to self.hight*2 This makes the actor much much bigger then 200

interpolate self.hight to self.hight/2 this makes the actor much much smaller than 50

can someone explain? think its getting stuck in a loop?

and what math you use interpolate to *2 hight or /2 hight

thanks

Comments

  • DimensionGamesDimensionGames PRO Posts: 993
    Im struggling to see what your confused with? If your using both these expressions when just touch is pressed this will cancel each other out.
  • ShineyGamesShineyGames Member Posts: 157
    Bright-Spark-Games said:
    Im struggling to see what your confused with? If your using both these expressions when just touch is pressed this will cancel each other out.

    sorry they are in timers and making the actor bigger then smaller with interpolate

    I no other ways to do this just trying to understand the maths
  • DimensionGamesDimensionGames PRO Posts: 993
    So what exactly is going wrong?
  • PhoticsPhotics Member Posts: 4,172
    ShineyGames said:
    can someone explain? think its getting stuck in a loop?

    It's not a math problem. It's a behavior problem.

    The value in Interpolate is changing.

    At 50 pixels, it's trying to grow to 50 x 2
    At 75 pixels, it's trying to grow to 75 x 2

    Your target value is changing.

    To fix this, you can use an attribute to store the target size... like self.targetX

    If actor is touched,
    Change self.targetX to self.size width*2
    Interpolate self.size width to self.targetX
  • ShineyGamesShineyGames Member Posts: 157
    Thanks

    Thats what I'm doing just did not understand why it did not work the other way
Sign In or Register to comment.