Class Soundscape
A soundscape is a set of background/ambient sounds that play to enhance the atmosphere of the game. To create a new soundscape, it can be added to Soundscapes.
public class Soundscape
- Inheritance
-
Soundscape
- Inherited Members
- Extension Methods
Constructors
Soundscape(IntensityDelegate, params SoundEffect[])
Creates a new soundscape with the given settings.
public Soundscape(Soundscape.IntensityDelegate intensityFunction, params SoundEffect[] sounds)
Parameters
intensityFunction
Soundscape.IntensityDelegateThe intensity function that determines the intensity of this soundscape at any given position.
sounds
SoundEffect[]The set of sound effects that this soundscape should contain, which will be randomly chosen from.
Fields
Soundscapes
The set of soundscapes that are active in the game. To create a new soundscape and to have its Update(Map, Camera) method called while in-game, it can be added to this collection.
public static readonly List<Soundscape> Soundscapes
Field Value
Methods
GetDaytimePercentage(Map)
Returns a number between 0 and 1 that determines how bright the sun currently is, based on the passed Map's Time.
public static float GetDaytimePercentage(Map map)
Parameters
map
MapThe map.
Returns
- float
The daytime percentage.
GetForestedness(Map, Vector2)
Returns a number between 0 and 1 that determines how forested an area around the given cameraWorldPos
is.
public static float GetForestedness(Map map, Vector2 cameraWorldPos)
Parameters
map
MapThe map.
cameraWorldPos
Vector2The camera position, in world coordinates.
Returns
- float
The forestedness.
Update(Map, Camera)
Updates this soundscape, querying its intensity function and playing its sound effects.
public virtual void Update(Map map, Camera camera)
Parameters
map
MapThe map that the soundscape should play on.
camera
CameraThe game's camera.