I am trying to create a game that when two pictures are connected and correctly corresponding a new screen or object appears. It seems as though my objects are not taking on the variables that they should be.
This is what happens when the 2 objects collide. I know that part of it is working because the new Greenfoot Image "IntAnswer3" is drawn. The problem is that the object Int3 is not taking on the connected or correct variables that I need it to. How do I fix this?
private void collision1(){
LogarithmInteractive interactive = (LogarithmInteractive)getWorld();
if (removed == false){
if (!interactive.getObjects(IntPlaceholder2.class).isEmpty()) {
Actor int2Img = getOneIntersectingObject(IntPlaceholder2.class);
if (int2Img != null){
getWorld().removeObject(int2Img);
GreenfootImage image = new GreenfootImage("IntAnswer3.png");
getWorld().getBackground().drawImage(image,490,35);
getWorld().removeObject(this);
connected = true;
correct = false;
removed = true;
}
}
}
}
