Skip to content

Commit 6070bc6

Browse files
committed
Sound.play now returns the Sound object (thanks @AnderbergE, fix phaserjs#802)
1 parent c94e842 commit 6070bc6

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ Version 2.0.5 - "Tanchico" - in development
9393
* Tilemap.createFromObjects will now force the creation of the property again even if it doesn't exist (regression fix from 2.0.4)
9494
* Phaser.Line.intersectsPoints fixed by properly checking the boundaries (thanks @woutercommandeur, fix #790)
9595
* Group.set and setAll were changed in 2.0.4 to not create the property unless it existed. This broke backwards compatibility, so has been fixed.
96+
* Sound.play now returns the Sound object (thanks @AnderbergE, fix #802)
9697

9798

9899

src/sound/Sound.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ Phaser.Sound.prototype = {
432432
if (this.isPlaying === true && forceRestart === false && this.override === false)
433433
{
434434
// Use Restart instead
435-
return;
435+
return this;
436436
}
437437

438438
if (this.isPlaying && this.override)
@@ -486,7 +486,7 @@ Phaser.Sound.prototype = {
486486
else
487487
{
488488
console.warn("Phaser.Sound.play: audio marker " + marker + " doesn't exist");
489-
return;
489+
return this;
490490
}
491491
}
492492
else
@@ -623,6 +623,9 @@ Phaser.Sound.prototype = {
623623
}
624624
}
625625
}
626+
627+
return this;
628+
626629
},
627630

628631
/**

0 commit comments

Comments
 (0)