i've made a game that involve picking up and object and places it in a different location.
i have a little problem, i want the removed object to reappear in the area it was dropped, is that possible?
thanks in advance
david
// instance fields
Actor objHeld = null;
// picking up
if (objHeld == null && Greenfoot.isKeyDown("u"))
{
objHeld = getOneIntersectingObject(Whatever.class);
if (objHeld != null) getWorld().removeObject(objHeld);
}
// releasing
if (objHeld != null && Greenfoot.isKeyDown("r"))
{
getWorld().addObject(objHeld, getX(), getY());
objHeld = null;
}