Hey there!
I'm trying to remake Minesweeper and trying to delete the "cover" block (undiscoveredCell) of the square that is clicked so as to reveal what's beneath. However, I don't know how to retrieve and subsequently delete the object that the mouse cursor is hovering over when clicking. I can't delete all actors from a given class, since the world is filled with a bunch of actors from the same class and I don't want all of them to be gone.
Here's my current code:
I've tried using the getObjectsAt method as I've read about it online, but greenfoot doesn't recognize it ("cannot find symbol - method"). Am I maybe missing a library that I need to import, and am I even using the method correctly?
MouseInfo mouse = Greenfoot.getMouseInfo(); if (mouse != null) { int buttonNumber = mouse.getButton(); if (buttonNumber == 1){ getWorld().removeObject(getObjectsAt(mouse.getX(), mouse.getY(), undiscoveredCell.class)); } }