Sounds on the client
This commit is contained in:
@@ -31,6 +31,8 @@ import { in_desktop_app, type JoinServer, TitleScreen } from "./gui/title_screen
|
||||
import { MainMenuScreen } from "./gui/main_menu.ts";
|
||||
import { DisconnectedScreen } from "./gui/disconnected_screen.ts";
|
||||
import { profiler } from "./profiler.ts";
|
||||
import { sounds } from "./sounds.ts";
|
||||
import { WebAudioOutput } from "./audio_output.ts";
|
||||
|
||||
// runs whatever is showing every frame: a menu screen before joining (and after leaving), or the game
|
||||
export // while playing, the browser asks before leaving the page. sprinting is ctrl and walking is w, and ctrl+w closes the
|
||||
@@ -231,6 +233,8 @@ try {
|
||||
}
|
||||
|
||||
InputManager.initialize(game_canvas);
|
||||
// waits for the first click or key, which the title screen gets
|
||||
sounds.set_output(new WebAudioOutput());
|
||||
self.addEventListener("resize", resize_canvas);
|
||||
resize_canvas();
|
||||
canvas.addEventListener("contextmenu", (event) => event.preventDefault());
|
||||
|
||||
Reference in New Issue
Block a user