My actor's addedToWorld method isn't being called for some reason. Any ideas?
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class Word here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Word extends Actor
{
String word;
boolean isInWorld = false;
public Word(String word) {
// This method is called once when the object is instantiated
this.word = word;
GreenfootImage img = new GreenfootImage(this.word, 20, Color.BLACK, Color.WHITE);
setImage(img);
}
/**
* Act - do whatever the Word wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
// Add your action code here.
setLocation(getX(), getY() + 3);
if (getY() > 380) {
isInWorld = false;
getWorld().removeObject(this);
}
}
protected void addedToWorld(World world) {
// This method is automatically called when an object is added to the world
System.out.println("Added to world: " + word);
isInWorld = true;
}
public boolean isInWorld() {
return isInWorld;
}
}

