This week I basically just worked on some sound implementation in order to further improve our game for green light. This is not something that is needed for green light, but having it done before hand is going to just make everything a lot easier and allow the sounds to be put into the game as soon as we have them done. Placing the sounds in the game is as easy as dragging ( one or more sounds) and dropping on each fighter move.
When the player actually attacks, the scripts grab a random sound from the fighter move that is being used by the player, figures out a random pitch based on two modifiers that out designers will set depending on what they think sounds best, and then plays the sound. There are two different variables in the list of type FighterSoundSet. The FighterSoundSet is a serialized class that allows anyone to edit them in the inspector, but keeps them private in code for my use. Each of these classes are basically just a list of type AudioClip with a function called getRandomClip(float pitch).
The lists are simply there in order to hold the sounds while the pitch is passed in as an "out" reference in order to get a random pitch value as well as (its normal return value) the random AudioClip grabbed from the move itself.
Basically this will allow us to have a lot of functionality for the sounds that the characters will be making. Ryan will be able to, after he makes all the sounds, simply be able to drag and drop as many sounds as he wants on each move and adjust the pitch range accordingly. If there is only one sound, that sound will play every time that move is used, but will sound slightly different depending on the pitch that gets returned from the function.
No comments:
Post a Comment