I want to make it so that when my one bacteria hits the left side of the world, all the bacteria speed up by one speed. They start at -6, and when one hits the wall they speed up to -7 and so on. I have this code but it totally does not work
/** * Float along the bloodstream, slowly rotating. */ public void act() { edge(); turn(2); setLocation(getX()-6, getY()); if (isAtEdge()) { getWorld().removeObject(this); } } public void edge() { if (getX() < 2) { setLocation(getX()-1, getY()); } } }