1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | public void act() { setRotation(direction); move(speed); touchingTheWall(); Actor disk1 = getOneIntersectingObject(Player2. class ); if (disk1 != null ) { World myWorld = getWorld(); Level1 level1 = (Level1)myWorld; Counter counter = level1.getCounter(); counter.addScore(); myWorld.removeObject( this ); } } public void touchingTheWall() { Actor contactwithwall = getOneIntersectingObject(PlasmaWalls. class ); Actor contactwithBoundary = getOneIntersectingObject(BoundaryWalls. class ); if ( contactwithwall != null || contactwithBoundary != null ) { getWorld().removeObject( this ); } } } |

