How to make my collision mechanism better....
Its working but sometimes the actor passes through the blocks
public void stone()
{
boolean upKeyDown;
Actor Stone=getOneIntersectingObject(Stone.class);
);
if(Greenfoot.isKeyDown("w") && Stone !=null)
{
speed=0;
}
if(upKeyDown != Greenfoot.isKeyDown("w") && Stone !=null)
{
move(-15);
}

