GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Interpolating size & colliding with actor

BluSpyderBluSpyder Posts: 129Member
edited April 2012 in Working with GS (Mac)
I have a few actors that are power ups in my game. When the main actor collides with them, they are destroyed and then the power is applied to the main actor.

My power ups seemed dull to look at, so I added interpolating size attributes to them:
When self.Size.height = 30 & self.Size.width = 30 --> interpolate self.Size.height to 20 & self.Size.width to 20
When self.Size.height = 20 & self.Size.width = 20 --> interpolate self.Size.height to 30 & self.Size.width to 30


So they are constantly growing and shrinking, like a blinking effect.

This is exactly how I want them to be, but the issue I'm having is they aren't applying the power or destroying themselves immediately when my main actor collides with them. The main actor has to stay on it for a second before anything will happen. So I'm guessing interpolation disrupts colliding? Is there a better way to do this or fix it?

(What I've done right now is made their images as gifs instead, so it is just an animation instead of the attributes in the game. But I don't like this as it seems more choppy and takes more images and space in the game.)

Thanks.

Best Answer

  • JohnPapiomitisJohnPapiomitis Posts: 6,256Member
    Accepted Answer
    Try using a timer with change attributes to change the size, that shouldnt mess up the collisions at all.

Answers

  • BluSpyderBluSpyder Posts: 129Member
    Try using a timer with change attributes to change the size, that shouldnt mess up the collisions at all.
    Like:

    While self.Height.size > 20 --> Every 0.1 seconds change self.Height.size to self.Height.size - 1

    ?

    I still want it to gradually change it's size, not immediately.
  • JohnPapiomitisJohnPapiomitis Posts: 6,256Member
    Yep
  • BluSpyderBluSpyder Posts: 129Member
    Works, thanks @JohnPapiomitis
This discussion has been closed.