OH! didn't see that.
mport greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Emoticon here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Emoticon extends Actor
{
private String[] soundFile;
private void emoticon(String image, String soundFile)
{
setImage( image + ".png"); sound = soundFile;
}
/**
* Act - do whatever the Emoticon wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
// When the mouse is click on this object, play the sound.
if(Greenfoot.mouseClicked(this))
{
Greenfoot.playSound(sound + ".wav");
}
}
}
public Emoticon(String image, String soundFile)
{
setImage( image + ".png");
sound = soundFile;
} public Emoticon(String image, String soundFile)
{
setImage( image + ".png");
sound = soundFile;
}