@Override
	public void move(int x, int y) {
		try{
			if((bitMap.Map[(body[0].x)+x][(body[0].y)+y].Resident==null)&&bitMap.Map[(body[0].x)+x][(body[0].y)+y].medium==0)	
			{
				
				int[] xyhold = {body[0].x,body[0].y};
				bitMap.Map[body[0].x+x][body[0].y+y].color = body[0].color;
				body[0]= bitMap.Map[body[0].x+x][body[0].y+y];
				body[0].Resident = this;
				
				for(int i = 1; i  <= length; i++){

			int xhold = body[i].x;
			int	yhold = body[i].y;
			 bitMap.Map[xyhold[0]][xyhold[1]].color = body[i].color;
			body[i]= bitMap.Map[xyhold[0]][xyhold[1]];
			xyhold[0] = xhold;
			xyhold[1] = yhold;
			body[i].Resident = this;
		
			if(i == length){
				bitMap.Map[xhold][yhold].color=(5963797+255*10);
				bitMap.Map[xhold][yhold].Resident= null;
			}
			
			
			}
				if(length == 0)
				{	bitMap.Map[xyhold[0]][xyhold[1]].color = (5963798+255*10);
					bitMap.Map[xyhold[0]][xyhold[1]].Resident = null;
				}
			
			
		
			
			}
			
		
			
			else{
				direction = ((direction+1)%4);
				life-=1;
				
			}
			}catch(ArrayIndexOutOfBoundsException e ){
				direction = ((direction+1)%4);
			}
		ready = 0;
		
		
	}