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
  • Hello, I need help answering these two questions. Thank you! 1. How do I make 5...

    Hello, I need help answering these two questions. Thank you! 1. How do I make 5 mL of a 1/10 dilution of a solution? 2. How do I figure out the concentration of an undiluted solution(I have the absorbance but the reading is off) if I am unable to use a standard curve?

  • How do I ask my school for permission to have the students make crafts as soon...

    How do I ask my school for permission to have the students make crafts as soon do not have things, and being out of school for the holiday cause trauma for some of our students? I want permission for the students to take their minds off of not having by giving them an opportunity to make some fun crafts that they can keep or give away? All of the crafts are nature-related like pine cones, trees, and wood decorations to...

  • If i have a node list type string, how do i put the data from each...

    If i have a node list type string, how do i put the data from each node into a string array and print the results? I am creating the node list myself so i just need generic code how to print the data from each node into a String array. 1670 * 168 * Returns an array of the words in the list, in the order that the client * would expect. * * 169 170 171 172 * *...

  • genetics i need help woth good details How many possible open reading frames (frames without stop...

    genetics i need help woth good details How many possible open reading frames (frames without stop codons) exist that extend through the following sequence? Note: since this is a partial sequence, do not consider start codons when looking for open reading frames. (STOP CODONS = UAA, UAG, UGA) 5 -----CTTACAGTTTATTGATACGGAGAAGG----3' 3'-----GAATGTCAAATAACTATGCCTCTTCC-----5' HTML Editora

  • I am involved in trading and I need a question answered. If I have £800 and I gain 200 pips on 5 trades at a risk of 0.20 a trade how much money do I make a week?

    I am involved in trading and I need a question answered. If I have £800 and I gain 200 pips on 5 trades at a risk of 0.20 a trade how much money do I make a week?

  • How do you write a failure analysis report of a company? For my business class I...

    How do you write a failure analysis report of a company? For my business class I am doing a failure analysis report on a company. I am wondering how you set it up and write it? Like what are the different sections you touch on? I am having a hard time finding any information on how to write one. It is supposed to be 9 pages.

  • how can I Use fscanf() inside a loop to read each line in C language? also...

    how can I Use fscanf() inside a loop to read each line in C language? also how can I take the values from the file and add them together for example if the file contents are 2 4 6 I want to read the first line and add 2 then the second one and add 4 and then the third and 6 and finally return the total 12 and stop reading. I do not want to store the values in...

  • How do I solve this in Excel to spit out the last Cash Flow given a...

    How do I solve this in Excel to spit out the last Cash Flow given a certain IRR? 3. I am expecting a final CF payment on 7/1/2019. What wouild this cash flow need to be in order to achieve a 20% (rounded to nearest 0.013%] IRR Output the answer in cell D26. Answer marst be correct to the nearest round umber Dates of Cash Flows /122014 1/31/2015 9/30/201 6/30/2016 4/30/20118 5/31/2018 /1/2019 enual Discount Rate 20% Cash Flows 1,000....

  • Data Structure Question How do you understand Dynamic Hashing Extendable and Linear easily. I am confuse...

    Data Structure Question How do you understand Dynamic Hashing Extendable and Linear easily. I am confuse how to do it. Please help Just to make an example these are the number 14, 91, 56, 11 , 12, 213, 54, 251, 78, 142, 118 I am confuse of how the Dynamic hashing work please help.

  • How do I solve 10 From The Physies Classroom's Physies Interactive Stop the simulation and use...

    How do I solve 10 From The Physies Classroom's Physies Interactive Stop the simulation and use the y-equation boxes to retrieve values for the y-displacement of Wave 1, Wave 2, and the Wave Sum at the four different locations along the medium. Yst i1n Location YL (m) 1.0-m Mark 1 0.23C 0.109 L19 0.0C 1.5-m Mark 2.0-m Mark 0109 - 0.290 3.0-m Mark .9 10. Make a claim regarding the relationship between Y, Ya, and YsuM. Support your claim with...

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