Hey guys,
I'm currently working on some kind of Shoot'em Up game ( AGK2 Tier 1 ).
I'm using the AppGameKit Player on my Galaxy S4 to play and test it.
Sometimes (it happens very rarely) when I kill the boss, the sound of the boss doesn't stop playing.
When the boss spawns, I do a
PlaySound ( SFX_Move_Boss, 90, 1 )
When the boss dies, the following code is executed. Everything works fine but the StopSound command (as said, it happens very rarely)
if GetSpriteCollision ( plasma[i].ID, boss.ID )
StopSound ( SFX_Move_Boss )
ShowBossExplosion ( boss.x, boss.y )
DeleteSprite ( plasma[i].ID )
Deletesprite ( boss.ID )
SetParticlesVisible ( boss.particle, 0 )
inc game.score, 5000
endif
One wave later, the boss spawns again, and the sound is played again
PlaySound ( SFX_Move_Boss, 90, 1 )
--> should be 2 instances now, right?
When I kill him then, both sounds stop.
Anyone else experienced a similar problem with StopSound()?
(EDIT)
I was able to reproduce the bug. StopSound() was definitely executed, but ignored.
I did a
ID = PlaySound ( SFX_Move_Boss, 90, 1 )
so I have the handle for GetSoundInstancePlaying()
When the bug occurs, and the sound continues playing although it should have stopped, and the same sound is played again when the next boss spawns, I have 2 sounds playing simultaneously.
At this time ( when the 2 sounds are playing at the same time )
GetSoundsPlaying() returns 2
GetSoundInstancePlaying() returns 1
When I kill the boss now, StopSound() stops both sounds.
Maybe that helps finding the bug. Seems to happen only when using the AppGameKit Player. I need to compile an .apk and test it