////////////////// object scrolling utility
#define CLOUD_SPEED 6
//class CBackground
	//{

      //public:
      // background sprites
	csprite BackSprite[5];

	void LoadBackSprites (void)
	{
	for (int i=0;i<5;i++)
	{
	BackSprite[i].speed=random(5)+1;
	BackSprite[i].initialize(100,i*10);
	}

	bmp_grab("D:\\bitmaps\\clouda.bmp",&BackSprite[0],0);
	bmp_grab("D:\\bitmaps\\cloudb.bmp",&BackSprite[1],0);
	bmp_grab("D:\\bitmaps\\cloudc.bmp",&BackSprite[2],0);

	for ( i=3;i<5;i++)
	{
	BackSprite[i].frames[0]=BackSprite[i-3].frames[0];
	BackSprite[i].width   = BackSprite[i-3].width;
	BackSprite[i].height  = BackSprite[i-3].height;
	}

	}



       void ScrollBackSprites (void)
       {
       int i;

       // if gone past
       for (i=0;i<5;i++)
       {
	 BackSprite[i].x-=BackSprite[i].speed;
	 BackSprite[i].paste_x_db();

	 if (BackSprite[i].LeftBehindScreen())
	{
	  BackSprite[i].x=Getmaxx+BackSprite[i].width;
	  BackSprite[i].y=random(150)+BackSprite[i].height;
	  BackSprite[i].speed=random(CLOUD_SPEED)+1;
	}


       }
       //
       }






 //};




