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);
Username123456789 Username123456789

2021/1/20

#
Thank you for your help, but sadly I have lost my game. I believe what happened is it updated to a new version and the code isn't compatible, though i dont think that would happen, I cant access any of the code at all and the images wouldn't show up for a while. but all this dosn't matter as I have moved on in my course and I am no longer using Greenfoot. I might come back later, but as for now I have nothing to do with Greenfoot anymore. again I thank you for your help.
You need to login to post a reply.