So I have a variable in BaseClass
And when my bullet kills a Dummy (for example), it should add one to the counter
But in another class, LittleRedCapGun, I try to see the counter, and when it is at 1, a key should be placed
But when I kill the Dummy, LittleRedCapGun doesn't seem to notice the KillCounter going up by one, so the Key isn't added to my game.
The Bullet class extends BaseClass
The LittleRedCapGun extends LittleRedCap, which extends BaseClass
BaseClass extends Actor
What should I do to make LittleRedCapGun notice when a bullet kills something?
protected int KillCount;
if(getWorld() != null && canSee(Dummy.class) && Enemy==false)
{
World world = getWorld();
world.removeObjects(world.getObjects(Dummy.class));
KillCount++;
world.removeObject(this);
}if (WaveNumber==1)
{
if (KillCount==1)
{
world.addObject(new Key(),395,125);
}
}
