No problem. If you want to play only a single sound you can use
Greenfoot.playSound("soundfile.wav");
, too.
With GreenfootSound you are able to play music in loops, too.
You can play every MP3, WAV and some other Sound files with it.
GreenfootSound sound = new GreenfootSound("Your_Sound_File.MP3");
sound.play();
You have to place the music/sound files into the sounds folder in the project.
public void turnToMouse(){
MouseInfo m = Greenfoot.getMouseInfo();
turnTowards(m.getX(), m.getY());
double r = getRotation()/45;
int rI = (int) r;
if(r-rI>0.5)
rI++;
setRotation(rI);
}
Did you make it that way?
}
2013/10/13
Interior
2013/10/13
Dancing Fading Circles
2013/10/12
CombinatorialCircuitEditor
2013/10/11
CombinatorialCircuitEditor
2013/10/11
Doggy Dash
2013/10/11
Dual-method Locator
2013/10/11
Dancing Fading Circles
2013/10/11
Dual-method Locator
2013/10/11
Dual-method Locator