So basically the sound is a really short sound it only lasts about 3 seconds, but when I run it, the sound does not stop.
This is my code:
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.io.*;
/**
* Write a description of class Boat here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Boat extends Actor
{
/**
* Act - do whatever the Boat wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
if (getX() >1185)
{ move(-5);
}
if (getX() == 1185)
{
Greenfoot.playSound("crack.mp3");
}
}
}

