Hello all,
How do I change this code so that the objects will be removed when they hit the left edge of the screen (rather then the right)?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | public void act() { if ( this .atWorldEdge()== true ) { World world; world = getWorld(); world.removeObject( this ); return ; } } public boolean atWorldEdge() { if (getX() > getWorld().getWidth() - getImage().getWidth() || getY() > getWorld().getHeight() - getImage().getHeight()) { return true ; } else { return false ; } } |