1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Add basic sounds

This commit is contained in:
tobspr
2020-05-14 19:12:58 +02:00
parent e960773a15
commit af0f56b5e4
24 changed files with 87 additions and 56 deletions

View File

@@ -22,7 +22,7 @@ const essentialMainMenuSounds = [
const essentialBareGameAtlases = atlasFiles;
const essentialBareGameSprites = G_ALL_UI_IMAGES;
const essentialBareGameSounds = [MUSIC.gameBg];
const essentialBareGameSounds = [MUSIC.theme];
const additionalGameSprites = [];
const additionalGameSounds = [];

View File

@@ -4,6 +4,8 @@ import { Signal } from "../core/signal";
import { fastArrayDelete, fastArrayDeleteValueIfContained } from "./utils";
import { Vector } from "./vector";
import { IS_MOBILE } from "./config";
import { SOUNDS } from "../platform/sound";
import { GLOBAL_APP } from "./globals";
const logger = createLogger("click_detector");
@@ -63,7 +65,7 @@ export class ClickDetector {
captureTouchmove = false,
targetOnly = false,
maxDistance = MAX_MOVE_DISTANCE_PX,
clickSound = null,
clickSound = SOUNDS.uiClick,
}
) {
assert(element, "No element given!");
@@ -321,8 +323,7 @@ export class ClickDetector {
// If we should play any sound, do this
if (this.clickSound) {
throw new Error("TODO: Play sounds on click");
// GLOBAL_APP.sound.playUiSound(this.clickSound);
GLOBAL_APP.sound.playUiSound(this.clickSound);
}
return false;

View File

@@ -77,14 +77,14 @@ export const globalConfig = {
showEntityBounds: false,
showAcceptorEjectors: false,
usePlainShapeIds: true,
disableMusic: true,
// disableMusic: true,
doNotRenderStatics: false,
disableZoomLimits: false,
showChunkBorders: false,
rewardsInstant: false,
allBuildingsUnlocked: true,
upgradesNoCost: true,
disableUnlockDialog: true,
disableUnlockDialog: false,
/* dev:end */
},

View File

@@ -252,7 +252,7 @@ export class GameState {
* @returns {string|null}
*/
getThemeMusic() {
return MUSIC.mainMenu;
return null;
}
////////////////////