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

2015/10/2

Playing Sound When Crab has Turned a Certain Degree

letin letin

2015/10/2

#
I am trying to have a sound play whenever the crab in my scenario turns more than 18 degrees. This is what I have so far, but I have no idea how to make it so it only plays when it has turned more than 18 degrees. Can someone help me? " /** * Check whether a control key on the keyboard has been pressed. * If it has, react accordingly. */ public void checkKeypress() { if(Greenfoot.isKeyDown("left")) { turn(-4); } if(Greenfoot.isKeyDown("right")) { turn(4); } { Greenfoot.playSound("Whip Crack-SoundBible.com-330576409.wav"); } } "
You need to login to post a reply.