So I want to play a special sound but everytime it plays in my scenario, a error pops up(Exception in thread "SoundStream:file:/C:/Users/Admin/Desktop/DavidJonas/sounds/musik.mp3" java.lang.ArrayIndexOutOfBoundsException: 580)
Does somebody know how to fix this?
if(getY() ==500)
{
this.timer = this.timer +2;
if(this.timer>200)
{
setImage("schlappenunsichtbar.png");
setLocation(200,230);
Greenfoot.playSound("musik.mp3");
this.timer=0;
}
}
if(getY() ==230 && getX() == 200)
{
this.timer2 = this.timer2 +2;
if(this.timer2 >800)
{
setImage("Badeschlappengegner1.png");
Greenfoot.playSound("ping.mp3");
this.timer2=0;
setLocation(201,230);
}
}