Having come from a Flash AS2 background with a significant amount of my work being educational games that contain significant elements of voice over sequences, I could do with advice on how to structure my code without the use of a timeline (apologies to those not familiar with a timeline).
For example, one such game I am porting has a sequence as follows:
**Step 1:
Play audio file 0010
Character wave hands
Display another character in a tree
Step 2: to be actioned when audio file 0010 has finished playing
Play audio file 0020
Character stamp feet
Hide character in tree
Play sound effect 1
Step 3: to be actioned when audio file 0020 has finished playing
Play audio file 0030
Character point
Display button**
This sequence continues for another 12 steps before we get to the actual game interaction and at any point the user can click a help button to return to the beginning of the sequence.
So my question is basically how would you recommend coding such a flow of events.
I am thinking it could be done with a large switch statement that branches based on a state variable whereby I pass the next state to the play audio function so it can change the state when the audio is complete.
if state == "0010" then
playAudio("0010", "0020")
animateCharacter("character1", "wave")
animateCharacter("character2", "show")
elseif state == "0020"
end
I suspect there may be a standard way of dealing with this that those from a non-timeline based background may be able to enlighten me about?
Thanks
Paul
[import]uid: 7863 topic_id: 15960 reply_id: 315960[/import]
[import]uid: 3826 topic_id: 15960 reply_id: 59102[/import]