Hey Im making a space invaders look alike and i need to know how u let music stop playing this is my code:
I made an private GreenfoorMusic and made the music play in a loop but if you click on restart the music plays 2times please help?!
public class SpaceWorld extends World
{
private Human thePlayer;
private SpaceShip theEnemy;
private Counter ScoreCounter;
private GreenfootSound music = new GreenfootSound("Zelda Main Theme Song.mp3");
public SpaceWorld()
{
super(1180, 670, 1);
thePlayer = new Human();
theEnemy = new SpaceShip();
Spawn();
HumanSpawn();
music.playLoop();
ScoreCounter = new Counter("Score");
addObject(ScoreCounter, 60, 30);

