What I'm going for with this is to give the testhero object that I'm putting in a name, so I may then refer to the instance named "red" and thus have a program.
I've cobbled this together after reading a few threads here, but it's still just spawning a TestHero named TestHero that holds a private TestHero red value of null.
Assistance would be greatly appreciated.
public class Battleground extends World
{
public TestHero red;
/**
* Constructor for objects of class Battleground.
*
*/
public Battleground()
{
// Create a new world with 20x20 cells with a cell size of 32x32 pixels.
super(20, 20, 32);
setBackground("Soil.jpg");
TestHero red = new TestHero();
Governor chief = new Governor();
addObject (chief, 0, 0);
addObject (red, 2, 2);
setPaintOrder(Hero.class, Hospital_Tent.class, TestEnemy.class);
}
public TestHero getTestHero()
{
return red;
}
}


