![]() When the mouse is click on this object, play the sound. * the 'Act' or 'Run' button gets pressed in the environment. * Act - do whatever the Emoticon wants to do. Use the method setImage( filename ) to set the image.Įmoticon emoticon = new Emoticon(image ,sound ) set the instance variable sound to the value passed by the corresponding parameter set the instance variable image to the value passed by the corresponding parameter Sounds =new String("hello","happy","crying","ohno","raspberry") ĪddObject(new Emoticon(images, sound ), 70*(i+1), 50) ![]() Images =new String("smiley1", "smiley2", "smile圓", "smiley4", "smiley5") * The y value can be either hard coded or calculated * Determine the x value using a mathematical calculation * Note: concatinate the ".png" for images and ".wav" for the sounds * It should use the method addObject( Actor object, int x, int y) to add new Emoticons to your world. * It should loop 5 times (you can either hard code 5 or use code) ![]() Create a new world with 400x100 cells with a cell size of 1x1 pixels. * Constructor for objects of class HomeworkWorld. * Create two instance varaibles of type String * Write a description of class Emoticon here. Import greenfoot.* // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |