So I'm working on a platformer game and I had the idea to add falling blocks on one of the levels. By "falling blocks" I mean they look like any other ground block in the game, but when you step on it, it would fall from underneath you. I've tried a couple of different things but I can't seem to get it to work properly. Any help would be greatly appreciated. This is what I have right now :
private int vSpeed = 5;
private int acceleration = 1;
public void act()
{
checkDrop();
Drop();
}
public boolean checkDrop()
{
Actor Lemur = getOneIntersectingObject(Lemur.class);
if (Lemur == null)
{
return false;
}
return true;
}
public void Drop()
{
if (checkDrop() == true)
{
this.setLocation (getX(), getY() + vSpeed);
vSpeed = vSpeed + acceleration;
}
}

