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

2014/5/27

Help with trying to get something to happen only once

fyziqs fyziqs

2014/5/27

#
Hi, I'm making a Pacman sort of game. I need to have the intro sound play once before Pacman and the Ghosts are able to move. How can I achieve this? My current code is:
private boolean introPlaying();
if(!Greenfoot.isKeyDown("left") && !Greenfoot.isKeyDown("right"))
        {
            playPacmanIntro();
            introPlaying = true;
            if(isPacmanIntroStillPlaying())
            {
                introPlaying = false;
            }

        }
I'm quite lost, so any help would be much appreciated. Thanks :)
fyziqs fyziqs

2014/5/27

#
Nevermind. Got it.
AntonB AntonB

2014/5/30

#
Hello, fyziqs. If you did have any issues with your major assignment, you should have just emailed me! Kind regards, Anton Bogdanovych.
You need to login to post a reply.