This site requires JavaScript, please enable it in your browser!
Greenfoot back
Username123456789
Username123456789 wrote ...

2021/1/8

Flee

Username123456789 Username123456789

2021/1/8

#
how would you make a actor in the greenfoot world run away from another actor? I know that this allows for it to chase the "Bee," but I want to make a "Fly" run awa from the Bee. here is the code I mentioned BeeWorld myWorld = (BeeWorld) getWorld(); Bee bee = myWorld.getBee(); this.turnTowards(bee.getX(), bee.getY());
Username123456789 Username123456789

2021/1/8

#
I tried looking it up, but came out with no results
Username123456789 Username123456789

2021/1/8

#
I can get on and check later, I am just now getting out of school. gotta go
danpost danpost

2021/1/8

#
Username123456789 wrote...
BeeWorld myWorld = (BeeWorld) getWorld(); Bee bee = myWorld.getBee(); this.turnTowards(bee.getX(), bee.getY());
Add at end: this.turn(180);
You need to login to post a reply.