Josh thx. I don't use the move(); but then when the greeps at ship they stop also.
I have 2 other questions
1. How you make that one greep of you is waiting in the center of the pille? and how you make that the greeps turn back to the pille if they dropTomatoes at the ship?
Please follow the basic tutorial in the comment section of my greep video 4.1. This should get you on the right track. You can improve your code from there.
To make your greep move to the center of a tomato pile just get the tomato pile object (like in the code you posted before) and then get the coordinates of it's center using getX() and getY(). Once you have those coordinates you can tell your greep to move in that direction.
hi with which code you stopped a greep on the tomato pill? pls send me a pn i have try it with /** * Is there any food here where we are? If so, try to load some! */ public void stopatTomatoes() { // check whether there's a tomato pile here TomatoPile tomatoes = (TomatoPile) getOneIntersectingObject(TomatoPile.class); Greep greep = (Greep) getOneIntersectingObject(Greep.class); if ((tomatoes != null)&&( greep == null)) { but it hasn't the same effect
To make your greep wait at the tomato pile you simply don't use the move() command while you see tomatos. You only start moving again as soon as you have a tomato on your back. I hope this helps.
hmm
Josh thx. I don't use the move(); but then when the greeps at ship they stop also.
I have 2 other questions
1. How you make that one greep of you is waiting in the center of the pille? and how you make that the greeps turn back to the pille if they dropTomatoes at the ship?
kurdo4104 2 months ago
@kurdo4104
Hi Kurdo
Please follow the basic tutorial in the comment section of my greep video 4.1. This should get you on the right track. You can improve your code from there.
To make your greep move to the center of a tomato pile just get the tomato pile object (like in the code you posted before) and then get the coordinates of it's center using getX() and getY(). Once you have those coordinates you can tell your greep to move in that direction.
JoshTheSerious 2 months ago
kurdo4104 2 months ago
@kurdo4104
Hi Kurdo
To make your greep wait at the tomato pile you simply don't use the move() command while you see tomatos. You only start moving again as soon as you have a tomato on your back. I hope this helps.
Josh
JoshTheSerious 2 months ago