I have been using the MouseInfo mouse = Greenfoot.getMouseInfo() and the if (Greenfoot.mouseClicked(this) && mouse.getX() > 308 && mouse.getX() < 355 && mouse.getY() > 259 && mouse.getY() < 297) to create areas on an image that when clicked will perform an action. Is it possible to create a condition statement that requires the mouse to be click in two or more areas on the image before something is allowed to occur?
So far, this is what I have; however, it does not work:
public void wireRed_01() { MouseInfo mouse = Greenfoot.getMouseInfo(); { if (Greenfoot.mouseClicked(this) && mouse.getX() > 308 && mouse.getX() < 355 && mouse.getY() > 259 && mouse.getY() < 297 && Greenfoot.mouseClicked(this) && mouse.getX() > 521 && mouse.getX() < 575 && mouse.getY() > 259 && mouse.getY() < 297) { getWorld().addObject(new Wire_Red_01(), 445,274); getWorld().setPaintOrder(Wire_Red_01.class); } } }