Jump to content


Photo

Synchronising sound and animation.


  • Please log in to reply
2 replies to this topic

#1 squeakydave

squeakydave

    GMC Member

  • GMC Member
  • 20 posts
  • Version:GM:HTML5

Posted 24 February 2012 - 11:30 AM

Hi There. I'm new to this (done the first tutorial) and using drag and drop.
A little background:
I'm testing Gamemaker with the view to buying GM HTML5 in order to make e-cards. I usually use Flash to do this but with the current move away from that technology I'm looking to find a way to make my cards in HTML5.

My test project is to replicate this card in game maker.

So far I have the animation loaded in as a sprite and created a dragon object.
My events are:
Create - change the sprite to sub image to 0 and hold (speed 0)
left pressed - sub image to 1 and play (speed 1)
Animation end - sub image to the last image of the sprite.

What I am trying to do is to play a sound when the button is pressed and the sprite hits the correct sub image.
I can't seem to find a way to do this with drag and drop. Any hints and tips as to how I could do this would be gratefully received.
  • 0

#2 creativebunch

creativebunch

    The Bunchiest

  • GMC Member
  • 886 posts
  • Version:GM:Studio

Posted 24 February 2012 - 01:12 PM

I haven't used DnD in a very long time but this should be what you want:

Create a step event in the dragon object, in the control section of actions at the bottom you'll see this icon:

:GM073:
variable: image_index
value: (The sub img numb)
operation: equal to

:GM031:
You should know what to do here.

Repeat the process with every sub img that should have a sound :thumbsup:
  • 0

#3 squeakydave

squeakydave

    GMC Member

  • GMC Member
  • 20 posts
  • Version:GM:HTML5

Posted 24 February 2012 - 01:50 PM

Many thanks for that. It works like a charm. It also gives me a great pointer for further exploration. Posted Image
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users