This site requires JavaScript, please enable it in your browser!
Greenfoot back
void.null
void.null wrote ...

2020/11/19

Game over sound effect not playing

void.null void.null

2020/11/19

#
I am making an attempt at a stickman scenario and when the stickman hits either end, it dies. Ive been trying to add a sound effect for when the sitckman reaches the edge but no sound will play. Heres the code
/**
     * This sound plays when you die
     */
    public void GameOver()
    {
        if(isAtEdge())
        {
            Greenfoot.playSound("gameover.wav");
        }
    }
danpost danpost

2020/11/20

#
(1) Do you call this GameOver method from the act method? (2) Did you place the gameover.wav sound file into the sounds folder of your project folder?
You need to login to post a reply.