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

2014/11/8

Playing a sound when the counter reaches the score of 10?

DiplomatikCow DiplomatikCow

2014/11/8

#
I want to make my game play a sound when the score reaches, ten, however, I have tried but have no clue how to do it. Help???
danpost danpost

2014/11/8

#
You should show what you have tried when asking for help (use the 'code' link below the reply box to post code and copy/paste any error messages you might be getting).
davmac davmac

2014/11/8

#
I want to make my game play a sound when the score reaches, ten, however, I have tried but have no clue how to do it. Help???
When you want to do something when some other condition is true, you use an 'if' statement:
if (condition) {
  do_something;
}
You need to replace the 'condition' and 'do_something' with suitable code. You need to put the "if" statement in your act method, or in some method that your act method calls, so that it continuously checks the condition.
You need to login to post a reply.