public void act(){
if (Greenfoot.mouseClicked(this)){
try{
Class cls = Class.forName(type);
tower = (Tower)cls.newInstance();
} catch (Exception e){
System.err.println(e);
}
getWorld().addObject(tower, 0, 0);
}
if (tower != null && !tower.placed && tower.getWorld() != null){
buy(tower);
}
}