Play sounds very near the player at full volume, but spatialize chip pickups
This commit is contained in:
1 parent
a088e50b3b
commit
15a8be1c15
3 files changed
+11
-11
No files matched your search
+5
-5
@@ -2556,18 +2556,18 @@ export class Level extends LevelInterface {
|
||||
tile[key] = val;
|
||||
}
|
||||
|
||||
collect_chip() {
|
||||
collect_chip(actor) {
|
||||
if (this.chips_remaining > 0) {
|
||||
if (this.chips_remaining > 1) {
|
||||
this.sfx.play_once('get-chip');
|
||||
this.sfx.play_once('get-chip', actor.cell);
|
||||
}
|
||||
else {
|
||||
this.sfx.play_once('get-chip-last');
|
||||
this.sfx.play_once('get-chip-last', actor.cell);
|
||||
}
|
||||
this.chips_remaining--;
|
||||
this.chips_remaining -= 1;
|
||||
}
|
||||
else {
|
||||
this.sfx.play_once('get-chip-extra');
|
||||
this.sfx.play_once('get-chip-extra', actor.cell);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -270,11 +270,11 @@ class SFXPlayer {
|
||||
if ('positionX' in listener) {
|
||||
listener.positionX.value = 0;
|
||||
listener.positionY.value = 0;
|
||||
listener.positionZ.value = -8;
|
||||
listener.positionZ.value = -7;
|
||||
}
|
||||
else {
|
||||
// Old way, only one Firefox supports atm ú_ù
|
||||
listener.setPosition(0, 0, -8);
|
||||
listener.setPosition(0, 0, -7);
|
||||
}
|
||||
if ('forwardX' in listener) {
|
||||
listener.forwardX.value = 0;
|
||||
@@ -465,7 +465,7 @@ class SFXPlayer {
|
||||
listener.positionY.value = y;
|
||||
}
|
||||
else {
|
||||
listener.setPosition(x, y, -8);
|
||||
listener.setPosition(x, y, -7);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -1340,7 +1340,7 @@ const TILE_TYPES = {
|
||||
blocks_collision: COLLISION.block_cc1 | COLLISION.monster_typical,
|
||||
item_priority: PICKUP_PRIORITIES.real_player,
|
||||
on_pickup(me, level, other) {
|
||||
level.collect_chip();
|
||||
level.collect_chip(me);
|
||||
return true;
|
||||
},
|
||||
// Not affected by gray buttons
|
||||
@@ -3105,7 +3105,7 @@ const TILE_TYPES = {
|
||||
blocks_collision: COLLISION.block_cc1 | COLLISION.monster_typical,
|
||||
item_priority: PICKUP_PRIORITIES.real_player,
|
||||
on_pickup(me, level, other) {
|
||||
level.collect_chip();
|
||||
level.collect_chip(me);
|
||||
return true;
|
||||
},
|
||||
},
|
||||
@@ -3115,7 +3115,7 @@ const TILE_TYPES = {
|
||||
blocks_collision: COLLISION.block_cc1 | COLLISION.monster_typical,
|
||||
item_priority: PICKUP_PRIORITIES.real_player,
|
||||
on_pickup(me, level, other) {
|
||||
level.collect_chip();
|
||||
level.collect_chip(me);
|
||||
return true;
|
||||
},
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user