Question

How do i make the creatures stop at tomatoes in Greenfoot The Greeps competion? How do...

How do i make the creatures stop at tomatoes in Greenfoot The Greeps competion? How do creatures spit and follow paint in Greenfoot? I am assuming that the person reading this question is familiar with Michael Kolling's Greenfoot pages 179 -183.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

port greenfoot.*; // (World, Actor, GreenfootImage, and Greenfoot)/*** A Greep is an alien creature that likes to collect tomatoes.* * @author (your name here)* @version 0.1*/public class Greep extends Creature{// Remember: you cannot extend the Greep's memory. So:// no additional fields (other than final fields) allowed in this class!/*** Default constructor for testing purposes.*/public Greep(){this(null);}/*** Create a Greep with its home space ship.*/public Greep(Ship ship){super(ship);}/*** Do what a greep's gotta do.*/public void act(){super.act(); // do not delete! leave as first statement in act().if (carryingTomato()) {spit("orange");if(atShip()) {dropTomato();}else {turnHome();if (atWater())turn(90);move(50);}}else {if (seePaint("orange")){turnHome();turn(180);}if (atWater())turn(80);if (atWorldEdge())turn(90);move(50);checkFood();

Add a comment
Know the answer?
Add Answer to:
How do i make the creatures stop at tomatoes in Greenfoot The Greeps competion? How do...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT