søndag 15. november 2009

Case 9 - Behold: Sound.

In this week we got to make sounds and music for our game. All the sound have to be triggered by AS3. It also has to be license-free, meaning that I can’t use for instance Britney Spears – Oop I did it Again in my game.

I wanted to have one special theme that was going to loop in the background, a sound when the hero picked up orbs, a sound for when the he hit enemies, some catch-phrases my hero would shout out every once and a while, and some other music bits I could use in my intro/outro. I tried looking on the internet on several free-sound web-pages, but I wasn’t completely happy with the material I found. Therefore I contacted a friend of mine, who makes digital music and sounds. I explained how my game worked and described what kind of sounds I wanted. And after a while I got some material that I’m very happy with.

The way of adding music was quite simple. On our group meeting on Monday I learned all I needed to know. This time Ole Andreas created a chat-like thing in our Fronter-room that he used to show us what code we needed to use sound in AS3. I think that method worked out really good, because we could all talk, read/write the code, and use the code by typing it in our own scripts at the same time.

The way I added sound to my game was quite easy. First I imported the necessary properties, made variables for the sound I would use from my library, and then I made variables for 3 different sound channels. By creating sound channels you can play several sounds “on top of each other”. For instance background music and a sound when you pick up orbs. I created one channel for background sound/music, one for sound-effects, and one for vocals.

I managed to add a background music easily and a sound when you pick up an orb. One problem I’ve encountered here is that I chosen to just scale the orbs down to 0 when they’re picked up, instead of removing them, and that leads to that every time I walk over the place where an orb used to be, the sound is also played. I’m currently working on this at the moment and I won’t publish a new version of the game before I feel comfortable with it.

1 kommentar:

  1. EMBARRASING LACK OF PICTURES ON YOUR LATEST POSTS. Are you TRYING, like the other douches in our class, to look bad? On the WORLD WIDE web? If you are, this is a great way to do it! If not, you just suck! Your game is epic, so show it off, god dammit! :(

    SvarSlett