@Kartoffelbrot @danpost
Help
public class Emoticon extends Actor { private String[] sound; private String[] image; private void emoticon(String image, String soundFile) { setImage( image + ".png"); } /** * 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"); } } }
private String sound;
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)) { sound = soundFile; Greenfoot.playSound(sound + ".wav"); } }
import 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[] sound; private String[] image; 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"); } } }