public void update()
	{
		time++;
		if(time % (random.nextInt(50) + 30) == 0)
		{
			xa = random.nextInt(3) - 1;
			ya = random.nextInt(3) - 1;
			

			if(random.nextInt(4) == 0)
			{
				xa = 0;
				ya = 0;
			}
			
		}
		
		if(walking) { animSprite.update(); }
		else { animSprite.setFrame(0); }
		
		if(ya < 0)
		{ 
			dir = Direction.UP;
			animSprite = up;
		}
		else if(ya > 0) 
		{ 
			dir = Direction.DOWN;
			animSprite = down;
		}
		if(xa < 0) 
		{ 
			dir = Direction.LEFT;
			animSprite = left;
		}
		else if(xa > 0) 
		{  
			dir = Direction.RIGHT;
			animSprite = right;
		}
		
		if(xa != 0 || ya != 0)
		{
//			move(xa, ya);
			walking = true;
		}
		else { walking = false; }
		
	}