Page 1 of 1

How do I read a sprite sequence?

PostPosted: Thu Aug 28, 2014 7:04 am
by vancouver
Hi,
I would like make a game which displays 3 sprites.
Each sprite has four frames.
The first frame (0) is blank and frames 1, 2 and 3 display the colour yellow, green and blue at random.
I also have audio files, each one second long, which say the colour name.

The included capx has all of the above already setup.

--------------------------------------------

What I would like to achieve is:

How do I play the sounds of all 3 four sprites in sequence (in a row) when the PLAY button is pressed?

I don't want the audio to play when the sprites are touched.

That's it.

Thanks for any advise, tutorial link or suggestions,

V :)

Re: How do I read a sprite sequence?

PostPosted: Thu Aug 28, 2014 10:46 am
by LittleStain
First you should insert the audio object plugin

This plugin has a condition on audio ended..

So on button clicked
subevent
system compare two values
col1.animationframe = 1
- audio play sound with tag "col1"

Audio on "col1" ended
bladibla etcetera etcetera..

You should make sure player input is suspended during the playback of the sounds so no unexpected things happen..

Re: How do I read a sprite sequence?

PostPosted: Thu Aug 28, 2014 11:45 pm
by vancouver
@LittleStain
thank you so much. I will try this tonight.

Sorry about the sound object (i forgot).

You last comment, about suspending player input during sound is brilliant! I didn't know that I can have the app and myself play audio at the same time.
THIS opens up a whole new door to accompaniments and two-voice harmony and and and ...

I am so excited and can't wait to mess with what you have suggested.

Ciao for now,
V :)