Our frustration with sound is finally over (hopefully). Craig and I worked in class today and were able to come to a solution with the sound problems.
The issue was that as the game ran, the sounds would loop over top of each other creating a terrible noise. Worse yet, when the user moved off of the frame with sounds, they would keep playing. Telling the movieclips to stop didn't help.
The solution was to change the sound sync mode to "stream" which forces the sound to sync with each keyframe. It's designed for sounds loaded at runtime, but it works for what we need it to.
The solution for stoping the animation is to loop through all of the movieclips contained in the current frame, stop them, then update the next frame. This should also improve performance for long story paths.
The only downside is that now we need to extend our animation loops to incorporate the required sound timing, but this is a small price to pay considering we finally got the thing to work.
Monday, April 23, 2007
Thursday, April 19, 2007
Saving
This week I got saving working, the processes is a bit convoluted, but it works:
1. The Story.Scene class was amended to add a private array of scene references. This array is static in the class, in other words it is a constant as the program runs.
2. As each scene is instantiated, it is added into the array of scenes, and each instance is added an id that corresponds to the array index.
3. When saving (SharedObject class), the id of the current scene is saved as a number. The state object can be saved normally, as it is a native data type.
4. When opening the program, if the SharedObject exists, it is used to begin the story, if not, the default beginning state is used.
All that's left for me to do is work on printing at this point. So my timeline is looking good.
1. The Story.Scene class was amended to add a private array of scene references. This array is static in the class, in other words it is a constant as the program runs.
2. As each scene is instantiated, it is added into the array of scenes, and each instance is added an id that corresponds to the array index.
3. When saving (SharedObject class), the id of the current scene is saved as a number. The state object can be saved normally, as it is a native data type.
4. When opening the program, if the SharedObject exists, it is used to begin the story, if not, the default beginning state is used.
All that's left for me to do is work on printing at this point. So my timeline is looking good.
Subscribe to:
Posts (Atom)