Game Development Reference
In-Depth Information
Figure 17-2. A screenshot of very shiny jewels
Adding Music and Sound Effects
Just like in the Painter game, you want to add music and sound effects to the game to make it more
attractive. As you've seen, playing music and sounds is very easy in JavaScript. You can use the
Sound class that you created earlier for Painter. This is another good example of reusing code: you
created the Sound class once, and you're using it for all the games in this topic!
Many of the classes designed for Jewel Jam will be useful for the other games in this topic. When
you start building your own games, you'll probably end up with a collection of similar classes that
you use. When building games, it's a good idea to think ahead. What classes can you reuse for other
projects you're working on? What is the best way to design a class so you might be able to use it
again later? As you develop more and more classes, it may be useful to keep a list of these classes
that you can reuse. You can then quickly scan the list as you develop new items and implement
things you might not have thought of.
 
Search WWH ::




Custom Search