GameSalad

Howdy, Stranger!

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

Is this possible???

VoiceExpressVoiceExpress Posts: 102Member, PRO
Hi Guys. Im currently working on an app where I need an animation to move its head up and down when touched. Ideally, Id like the head to shoot up when a button is pressed, audio then plays, once the audio has finished Id like the head to go back down, is this possible? Thanks

Comments

  • peachpellenpeachpellen Posts: 977Member
    When touch is pressed change image to headup (or whatevever)

    Then timer; after x seconds play sound

    Then timer after x seconds change image to headdown (or whatever)

    Hope that makes sense :)
  • firemaplegamesfiremaplegames Posts: 3,206Member
    You can also couple Timers with the Interpolate behavior, which forms a basic tweening engine.

    Rule
    When Touch is Pressed
    When game.busy = false
    Change Attribute: self.pleaseMoveHeadUpNow To: true
    Change Attribute: game.busy To: true

    Rule
    When self.pleaseMoveHeadUpNow = true
    -----Change Attribute: self.pleaseMoveHeadUpNow To: false
    -----Interpolate: self.Position.Y To: [target Y position] duration: [# of seconds]
    -----Timer After [# of seconds] run to completion
    ----------Play Sound
    ----------Interpolate: self.Position.Y To: [target Y position] duration: [# of seconds]
    ----------Timer After [# of seconds] run to completion
    ---------------Change Attribute: game.busy To: false
This discussion has been closed.