Hi all, I'd thought that I would create another discussion in case there are people who also have the same problem as me.
Like in my previous discussion I am trying to make a settings menu in my Settings world where it has options such as a button that mutes sound effects from actors in my PlayWorld.
I am not sure if this is even possible lol but if it is I'd appreciate if you let me know.
Below is my code (there are bits that I have cut out which isn't involved in producing sound effects)
Blueplayer
Redplayer
timer
Thanks in advance
public void act()
{
detectRedplayerCollision();
detectRayCollision();
collectMoneyNote();
if (isTouching(Home.class))
{
Greenfoot.playSound("fanfare.mp3");
}
public void detectRedplayerCollision()
{
if (isTouching(Redplayer.class))
{
Greenfoot.playSound("ouch.wav");
}
public void detectRayCollision()
{
if (isTouching(Ray.class))
{
Greenfoot.playSound("signal.mp3");
}
public void collectMoneyNote()
{
if (isTouching(MoneyNote.class))
{
removeTouching(MoneyNote.class);
Greenfoot.playSound("chaching.mp3");public void act()
if (isTouching(Home.class))
{
Greenfoot.playSound("fanfare.mp3");
}
{
detectBlueplayerCollision();
detectRayCollision();
collectMoneyNote();
}
}
public void detectBlueplayerCollision()
{
if (isTouching(Blueplayer.class))
{
Greenfoot.playSound("ouch.wav");
}
public void detectRayCollision()
{
if (isTouching(Ray.class))
{
Greenfoot.playSound("signal.mp3");
}
public void collectMoneyNote()
{
if (isTouching(MoneyNote.class))
{
removeTouching(MoneyNote.class);
Greenfoot.playSound("chaching.mp3"); public void act()
{
timeUpdate();
}
public void timeUpdate()
{
timer--;
getWorld().showText("Time Left : "+timer, 100,100);
if (timer == 0)
{
Greenfoot.playSound("sad.mp3");
}
}

