Class: World

World(simulator)

World class is responsible for managing the overall scene, including initialization and updating of different components such as the environment.

Constructor

new World(simulator)

Constructor for the World class. Initializes the simulator, scene, and resources. Sets up the environment after resources are loaded. Initializes the SubmarineView after resources are loaded.
Parameters:
Name Type Description
simulator Simulator The simulator instance.
Source:

Methods

resumeAudioContext()

Ensure the AudioContext is resumed after user interaction. Resumes the audio context if it is suspended.
Source:

update()

Update method to handle per-frame updates. Called on each frame to update the components in the scene.
Source:

updateBackgroundSounds()

Updates background sounds based on the submarine's position. Plays or pauses the appropriate sound based on whether the submarine is above or below water.
Source: