Animation issue...

EagleoneEagleone Member Posts: 97
edited November -1 in Working with GS (Mac)
I have an actor which moves all over the screen and is constantly animated while moving around. This actor also disappears once you touch it.

Problem:

I can't add an animation effect to this actor so when you touch it, there is like an explosion effect while it disappears. I've added the animation behavior but it just disappears without the animation. Perhaps the "destroy" behavior is the issue because once you touch this actor, it disappears, or?

Any help is appreciated.

Thanks.

Comments

  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    if you have a 'destroy behaviour' happening that would explain it.

    Have it so when actor is pressed, it plays the explosion animation and then after a timer (for however long your explosion is' then destroy the actor.

    Hope that makes sense and is what you were after.

    Good luck,...
  • EagleoneEagleone Member Posts: 97
    Yep, I though the destroy behavior might be an issue, just didn't know how to get around it. Didn't think of the timer though, thanks for the tip, will give that a go now!
  • QuinnZoneStudiosQuinnZoneStudios Member Posts: 452
    You could also interpolate the actor's Alpha to zero so it won't show but the explosion will, I think....
  • EagleoneEagleone Member Posts: 97
    stormystudio:

    Just tried that, doesn't work, hrmm...
  • EagleoneEagleone Member Posts: 97
    MikeQuinn,

    Still not very familiar with interpolate so not quite sure what you mean, but I'll have a look at some tuts on using this behavior and see if I can give it a go.

    Thanks for the tip.
  • StormyStudioStormyStudio United KingdomMember Posts: 3,989
    Hmm not entirely sure of your setup but interpolating alpha to 0 and recycling actors is te better option for performance on a device.

    But the other way is simpler to understand if your just getting into it.
    But to interpolate.

    It would be :

    Play normal animation

    If touch is pressed

    Play explosion animation

    And interpolate self alpha to 0
    Duration 1 second (or what ever time you prefer)

    You could always have the interpolate behaviour inside a timer so it does not start till after a set amount of time.
  • ShineyGamesShineyGames Member Posts: 157
    you could have a self attribute "destroy" boolean

    rule when destroy is false, animate (move anamation)

    otherwise, animate (destroy anamation)

    this will work

    then just have a rule when touch is pressed
    change attribute self.destroy to true
    timer
    after xxxtime destory actor

    i used this on my game blaster bugs and works well as i was having problems
    jason
  • EagleoneEagleone Member Posts: 97
    Thank you all for your input, I will try out all the methods mentioned and hopefully have it sorted.
  • freon1200freon1200 Member Posts: 50
    you could always just change attribute to alpha 0 too if you dont need it to fade. that should be less taxing than interpolate, tho im no pro, so im not 100% sure on the taxing issue. if im wrong someone please let me know =]
Sign In or Register to comment.