Script Classes for Adventure Games/Sound Class

From SCI Wiki
Jump to navigationJump to search

Official SCI Documentation

Chapter: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14
15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | Index


The Sound Class

Author: Jeff Stephenson

Date: 5 April 1988

 


The Sound Class

This is the class which allows sound to be played.

In file: game.sc
Inherits from: Object
Inherited by: none



Properties

done

Set to TRUE after the sound has finished playing, FALSE while it is playing.

number

The number of the sound.

priority

The priority of the sound if multiple sounds are playing. Most sound effects should have the default priority of 0. More important sounds (say an error beep) should have positive priorities — the more important the higher the priority. Less important sounds (background music) should have negative priorities. This will allow sound effects to override background music (which will resume at the appropriate point) and error beeps to override sound effects.

signal

This is a bit-mapped property used to set characteristics of the sound. Its bits are defined in base.sh. Only one bit, blockingSnd, is currently defined. When it is set, the sound blocks when it is playing — all game play stops until the sound is complete. Sampled sound effects are blocking sounds by default, and needn't have this bit set.


Methods

init:

Initialize the sound and set any appropriate bits in signal to indicate the sound's nature.

play:

Start the sound playing and add it to sounds, the list of sounds which are playing.

dispose:

Stop the sound.

 

Notes


 

Table of Contents

 

< Previous: The Cage Class Next: The StatusLine Class >