I want when I click on one of my character icons it to spawn my character in a different world this is what I have so far but it seems like it does nothing at the moment.
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class DookuIcon here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class DookuIcon extends Actor
{
World a = new MyWorld();
/**
* Act - do whatever the DookuIcon wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
if (Greenfoot.mouseClicked(this))
a.addObject(new Dooku(), 350, 500);
}
}

