Okay so what I'm trying to do is reduce the health when the "Fire" class reaches the bottom but it keeps saying it can't find the "fireWorld" variable. Am I in the wrong class? I really don't know what's wrong..
import greenfoot.*;
/**
* Write a description of class Fire here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Fire extends Actor
{
/**
* Act - do whatever the Fire 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.
move(1);
setRotation(90);
aangGone();
}
public void aangGone()
{
int yCoord = getY();
if(yCoord == 399)
{
getWorld().removeObject(this);
Volcano volcano = (Volcano)fireWorld; //cannot find fireWorld variable
Health health = volcano.getHealth();
health.lowerHealth();
}
Actor aang = getOneIntersectingObject(Aang.class);
if(aang != null)
{
World aangWorld = getWorld();
aangWorld.removeObject(aang);
}
}
}
