I am unsure how much longer I can extend the time that the ant can move based on goodCalorie and badCalorie for I am only limited to use 200 units for goodCalorie and 100 units for badCalorie.
I am unsure how much longer I can extend the time that the ant can move based on goodCalorie and badCalorie for I am only limited to use 200 units for goodCalorie and 100 units for badCalorie.
Do the values have to change every act cycle? Do they have to decrease at the rates you are currently using?
Every call to act will decrease goodCalorie by 1 and badCalorie by 5 units. In order to gain more bad energy, an Ant must collect Fries which increases bad energy up by 10 units and the same applies for good energy. If there is no good energy or bad energy left, then the Ant will die.
Every call to act will decrease goodCalorie by 1 and badCalorie by 5 units. In order to gain more bad energy, an Ant must collect Fries which increases bad energy up by 10 units and the same applies for good energy. If there is no good energy or bad energy left, then the Ant will die.
That does not seem like it do much good to eat fries then -- only gaining 2 act cycles worth of bad calories. At any rate, you do not currently have any code in the class that shows the ant eating anything and gaining calories, so the ant runs out of calories quickly.
Yes, this is for a project I am working on and the professor who assigned it is very picky with how things should work. I came here because I know there are more creative ways to work on projects than what my professor is providing to me. He has not taught us anything that really relates to the project so I was hoping for some more creative ways of learning here. Perhaps, if I post some of the directions, you could walk me through what it is I need to do.
Well, (1) you know how to construct an 'if' block and (2) you can see what methods are available for any Actor by looking into the Actor class documentation and (3) you know what the act method is for (hopefully). So, you should be able to attempt something.