View Single Post
  #5 (permalink)  
Old 11-05-2007, 08:24 PM
mispeed mispeed is offline
Member
 
Join Date: Nov 2007
Posts: 7
mispeed is on a distinguished road
hi, yea i was a little confused about the amountFood in the Cell class myself, so here is where in the pseudo code it is being used!

Code:
//class Cell //feed the creeper method public void feedCreeper() { //for each creeper for(i = 0; i < creepers.lenght; i++) { //check for food //if there is food in the cell :i'm guessing amount of food is just a var. //to store any changes to initialFood from Class one Universe amountOfFood = new Universe(); amountOfFood.getInitialFood(); if(amountOfFood.getInitialFood() != 0) { //add to weight and decrement food }//end if if(//weight is below minWeight(an instance var. in Class one)) { //set to null end if } //check if overweight and split creeper if so) if(weight > maxWeight) { //set weight to birthWeight, Create new Creeper(set its //birthWeight and its age) }//end if }//end for }//end feedCreeper //so still not exactly what amount of food is i hope the above helps /n //understand it! initialize process is one method called bigBang from Class One. It initializes everything(food, creepers, birthWeight) and find a cell.
Reply With Quote