Add positional sounds from the tilemap
This commit is contained in:
@@ -107,7 +107,8 @@ SoundSprite.prototype.update_new_values = function() {
|
||||
|
||||
SoundSprite.prototype.adjust_relative_to = function(spr) {
|
||||
if ( this.sound_alwaysplay == false ) {
|
||||
if ( ! this.inCamera ) {
|
||||
// we can't use inCamera because we don't have a body/sprite
|
||||
if ( ! game.camera.screenView.contains(this.x, this.y) ) {
|
||||
console.log("Sound is not on camera");
|
||||
// don't turn it off, let it continue at zero volume
|
||||
// for more realistic effect whe the player returns
|
||||
|
||||
Reference in New Issue
Block a user