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

2014/12/30

Please help!!! :-(

ILOVELABRADORS ILOVELABRADORS

2014/12/30

#
Greetings Greenfoot community, (awkward………*) Can anyone help me do something so an object (hamburger, in this case) has this sort of transparent or invisible square-shaped thing around it that is 40 cells in every direction? Then, another object is just running around and turning randomly (I don't need help doing that), so what I also need help on is whenever it enters a hamburger's "territory," it turns to face the hamburger, runs toward it, then eats it. I've found some codes that might help with this, such as: ~ getObjectsInRange ~ getNeighbours ~ setLocation ~ setRotation ~ turnTowards I'm not so sure though because I never used those codes before and I just went through the API and found those. I do hope this is not asking for too much! This is my homework ( not from school, like home homework. * I mean awkward way to start this discussion, I guess... Thanks a bunch!!! (-^_^-)
danpost danpost

2014/12/30

#
I need a better understanding of what you want, exactly. What part of the other actor has to be within 40 pixels (horizontally, vertically, or diagonally) of the hamburger ... the center of the actor? any part of its image? if the latter, is its image square?
You need to login to post a reply.