Now, this is caused by a reference, but I've looked it over again and again and can't figure out what's wrong.
All of the above works, except it says there is an error at the line "Character character = room.character;"
In the room class there is
I tried making it public static Character character = new Character(); but then the world just didn't load at all.
Derp.
public class Spikes extends Actor { Room room = (Room)getWorld(); Stats stats = room.stats; Character character = room.character; private int delay = 0; public void act() { if(delay > 0) { delay = (delay - 1); } if(getOneIntersectingObject(Character.class) != null && delay == 0 && (character.getY() - 5) >= (getY() - 25)) { //make it damage player on collision stats.damagePlayer(1); delay = 20; } } }
public Character character = new Character(); ....... addObject(character, 425, 525);