January 2016
Intermediate to advanced
304 pages
6h 17m
English
The final component that we're going to create is an audio component. Now, this is the first component that we'll create from scratch. However, our experience with the two previous components should make this one easy to implement.
This is slightly different from our past components. Instead of encapsulating existing behavior, we need to define it. We're going to create a simple audio component, and the only behavior that we're going to have is the ability to play a single sound effect. For this, we'll require a single variable to hold the sound object, a function to set a sound buffer, and a function to play the sound.
In the function that will be used to set the sound buffer, ...
Read now
Unlock full access