Is this possible???

VoiceExpressVoiceExpress Member, PRO Posts: 102
edited November -1 in Working with GS (Mac)
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 Member Posts: 977
    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 Member Posts: 3,211
    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
Sign In or Register to comment.