Game Development Reference
In-Depth Information
mySound.Play();
In all the games that we develop in this topic, we will use both types of sound
(background music and sound effects) to make the games more exciting.
Sound and music— Most games contain sound effects and background mu-
sic. These are important for various reasons. Sound effects give important
cues to indicate to the user that something has happened. For example, play-
ing a click sound when pressing a button provides feedback to the user that
the button was indeed pressed. Hearing footsteps indicates that enemies might
be nearby, even though the player might not see them yet. And hearing a bell
ringing in the distance can give an indication that something is about to hap-
pen. The old game Myst was a classic in this respect because many cues on
how to progress where passed to the player through sounds.
Atmospheric sound effects, like dripping water, wind in the trees, or the
sound of cars in the distance enhance the experience and give a feeling of
being present in the game world. They make the environment more alive,
even when nothing is actually happening on the screen.
Music plays a crucial role in the way players experience the environment
and the action. Music can be used to create tension, sadness, happiness, and
many other emotions. However, dealing with music in games is a lot harder
than in movies. In movies it is clear what is going to happen so the music can
match that perfectly. But in games, part of the action is under control of the
player. Modern games use adaptive music that constantly changes according
to how the game story evolves.
4.4 What You Have Learned
In this chapter, you have learned:
how to store information in the memory using variables;
what the basic numerical types are in C#;
how to load game assets such as sprites and sounds into the memory;
how to use the Update method to change the game world through the variables
and the Draw method to display the game world on the screen.
Search WWH ::




Custom Search