import greenfoot.*; public class Object extends other { public int dx; public int dy; public Object() { dx = 4; dy = 0; } public void act() { move(); setLocation(getX()+dx, getY()+dy); turn(5); } move() { Ho ho =(Ho) getOneIntersectingObject(Ho.class); if(ho ==null) { dx = -dx; } } }

