How do i have a my memory game spawn 6 different object for 6 times in a 6x6 tiles. I manage to spawn everything 6 times, but they keep overlapping each other. Also I will need to match the matched object and remove them later, how do i do that ?
Actor first = getObjectsAt(0, 0, null).get(0); // get actor at top-left
for (int i=0; i<100; i++)
{
Actor actor = getObjects(null).get(Greenfoot.getRandomNumber(36)); // get a random actor
first.setLocation(actor.getX(), actor.getY()); // replace random with top-left
actor.setLocation(0, 0); // complete the swap
first = actor; // assign new top-left
}if (firstChoice.getClass().getName().equals(secondChoice.getClass().getName()))