I have attempted to create a reset method by "re-initializing" the objects in question to new objects. What is happening is that some of the values stored in the objects are being reset, as per the constructors, yet some are not. Can anyone explain this?
public void reset(){
if(gameHasEnded){
dicaprio = new CoolCat();
}
}
above is an example of my reset method to reset the object below:
public CoolCat(){
area = LEO_START_AREA; //rectangle object
speed = 2 + (int)(5*Math.random());
direction = RIGHT;
}
- direction and speed appear to get reset but the area does not