-
-
Notifications
You must be signed in to change notification settings - Fork 539
ScriptingAmbientSound
Lennard Hofmann edited this page Dec 6, 2020
·
10 revisions
An ambient sound that was given a name can be controlled by scripts.
An AmbientSound
is instantiated by placing a definition inside a level. It can then be accessed by its name
from a script or via sector.name
from the console.
In the level file:
(ambient_sound
(name "niagara")
(x 10)
(y 20)
(width 100)
(height 51)
(distance_factor 0)
(distance_bias 0)
(sample "sounds/waterfall.wav")
(volume 100)
)
In a script:
niagara.set_pos(0, 0);
In the console:
sector.niagara.set_pos(18, 35)
Method | Explanation |
---|---|
set_pos(float x, float y) |
Sets the position of the ambient sound. |
float get_pos_x() |
Returns the x coordinate. |
float get_pos_y() |
Returns the y coordinate. |
- None
Home
Guidelines
Game Mechanics
Tools
Engine
- Cameras in other games
- Collision
- Configuration File
- Console
- Cutscenes
- Game_Engine
- Lighting
- Map_transformer
- Portables
- SceneGraph
- Scripting
Specifications
Milestones
- Milestone 1 Analysis
- Milestone 2 Design Document
- Milestone 2 Design Document Old
- Milestone 3 Design Document
Building (mostly outdated)
- INSTALL.md
- Building
- Building on macOS
- Building SuperTux
- Building on Windows
- Building with MXE (cross-compile)
Meetings