Hello again!
Progressed big time on my project with the help of davmac. I'm nearly done with the basic stuff, though I've still got two small questions.
First, when objects are moved onto each other one of their images will show on top. I want to see the images of one class on top at all times when these objects intersect. Is there a way to manage this?
Second, I want the world to check whether several objects are intersecting with several others that are located on specific locations. It is the goal of my game to move objects to these locations. If this is the case the World should be doing something, for now simply launch the next level.
Here's the info from my World that's probably relevant: (the crates can be moved, the goals is where they should be moved to)
addObject(new Crate(), 4, 3);
addObject(new Crate(), 3, 4);
addObject(new Crate(), 4, 5);
addObject(new Crate(), 5, 4);
addObject(new Goal(), 3, 2);
addObject(new Goal(), 6, 3);
addObject(new Goal(), 2, 5);
addObject(new Goal(), 5, 6);
if(getObjectsAt(3, 2, Crate.class) != null &&
getObjectsAt(6, 3, Crate.class) != null &&
getObjectsAt(2, 5, Crate.class) != null &&
getObjectsAt(5, 6, Crate.class) != null) {
levelTwo();
}
With this in the code, it moves to level 2 straight away, without the player to have needed to move a thing in level 1. What am I missing? Why is this?