I'm creating Flappy Bird within Greenfoot and my Counter class adds 2 points when i go into between the tubes instead of 1. I'm using this for my code
https://www.greenfoot.org/topics/60635/0
but within the pipe class which I'm trying to implement this it is adding 2. Here is my tube public void act code:
public void act()
{
setLocation( getX() + SPEEDO, getY());
if (getX()<=20)
((Counter)getWorld().getObjects(Counter.class).get(0)).add(1);
if(getX()<=20)
getWorld().removeObject(this);
}

