Will this work then? in regards to the with this code I'm getting the error 'cannot find symbol - method getWidth()'
danpost wrote...
Change 'minorPIP' at all places with 'pip'.public class Major extends World
{
PIP pip;
PIP pip2;
boolean wDown;
boolean sDown;
Actor mouseActor;
int mouseOffX, mouseOffY;
public Major()
{
super(1675, 910, 1);
//paint the background blue
GreenfootImage background = getBackground();
background.setColor(Color.blue);
background.fill();
//spawn the Bejeweled/puzzle world
World minor = new Bejeweled_World();
Class[] order = { Sword.class };
Class[] order2 = { Torch.class };
Class[] order3 = { Coin.class };
pip = new PIP(minor, order);
addObject(pip, 1070, 605);
}
public void act()
{
// control running state the wombat PIP objects
if (!wDown && Greenfoot.isKeyDown("1"))
{
pip.setActiveState(!pip.getActiveState());
wDown = true;
}
if (wDown && !Greenfoot.isKeyDown("1")) wDown = false;
// control running state the ship PIP objects
if (!sDown && Greenfoot.isKeyDown("2"))
{
pip2.setActiveState(!pip2.getActiveState());
sDown = true;
}
if (sDown && !Greenfoot.isKeyDown("2")) sDown = false;
if (pip != null && pip.getWorld() != null && Greenfoot.mouseClicked(pip))
{
MouseInfo mouse = Greenfoot.getMouseInfo();
if (mouse == null) return;
int x = (mouse.getX()-(pip.getX()-pip.getWidth()/2))/minor.getCellSize();
int y = (mouse.getY()-(pip.getY()-pip.getHeight()/2))/minor.getCellSize();
Tile.setSelected((Tile)minor.getObjectsAt(x, y, Tile.class).get(0));
}
}
}

instead of it earlier being in the bottom right corner of a blue background