I have an actor called "Robot". I want an actor called "Red_Ball" to move when Robot touches it. If anyone knows how that would work please answer. I'd be happy to post code for the stuff if it is necessary.
-Thank you
if (isTouching(Robot.class)) move(1);
public class Red_Ball extends Actor
{
public void act()
{
if (isTouching(Robot.class)) move(1);
}
}public class Robot extends Actor
{
public void act()
{
MoveAround();
}
public void MoveAround()
{
if (Greenfoot.isKeyDown("a"))
turn(-3);
if (Greenfoot.isKeyDown("d"))
turn(3);
if (Greenfoot.isKeyDown("w"))
move(3);
if (Greenfoot.isKeyDown("s"))
move(-3);
}
}