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

2012/11/24

HELP WITH EXPRESSIONS

mimia mimia

2012/11/24

#
hey guys, how would i turn an object by 30 degrees, which expression would i use? and also what is the method i would use for greenfoor to play a sound? please reply via email, or here Thanks! It would really help!
SPower SPower

2012/11/24

#
turn(30);
to play a sound, this is the easiest:
Greenfoot.playSound("name.extention");
but, if you've got a sound format that is not supported by this method, the only other option is to do this:
GreenfootSound sound = new GreenfootSound("name.extention");
sound.play();
the great thing here is that you can also pause it:
sound.pause();
And really, you should read the greenfoot documentation :)
Gevater_Tod4711 Gevater_Tod4711

2012/11/24

#
To turn an object use the method turn(int angle); turn(30) will turn the object 30 degrees. To play a sound use Greenfoot.playSound("theSoundFileAsAString.mp3"); also the greenfoot API chould be helpfull. All methods and classes greenfoot uses are listed there.
mimia mimia

2012/11/24

#
Thanks for your help!
You need to login to post a reply.