square = makesquare(50,"red"); 
square = setx(square, 350); 
square = sety(square, 250); 

circle = makecircle(10,"yellow");
circle = setx(circle, 150);
circle = sety(circle, 150);

rect = makerect(50, 20,"green");
rect = setx(rect, 400);
rect = sety(rect, 400);

circlesquare = makegroup();
circlesquare = addtogroup(circlesquare, circle);

angle=globalnumber();
angle2=globalnumber();
inc=globalnumber();

loop(1,23,k) {
	s = makesquare(7, "darkgray");
	s2 = makesquare(7, "lightblue");
	
	a = k * .3;
	
	cx = cos(a);
	sy = sin(a);

	// coordinates
	cx = cx * 80; cx = cx + 200;
	sy = sy * 80; sy = sy + 125;

	// place the first sprite
	s = setx(s,cx);
	s = sety(s,sy);

	cx = cx - 2;
	sy = sy - 2;
	
	// place the second sprite
	s2 = setx(s2,cx);
	s2 = sety(s2,sy);

circlesquare = addtogroup(circlesquare, s);
circlesquare = addtogroup(circlesquare, s2);
}

animate {
	inc=5;
	
    x=getx(circlesquare);
    y=gety(circlesquare);
    
    angle=angle+.1;
    
    cx = cos(angle); cx = cx * 100; 
    sy = sin(angle); sy = sy * 100;
    
    circlesquare=setx(circlesquare,cx);
    circlesquare=sety(circlesquare,sy);
    
    x=getx(rect);
    y=gety(rect);
    
    angle2=angle2-.2;
    cx = cos(angle2); cx=cx*50; cx=cx+200;
    sy = sin(angle2); sy=sy*50; sy=sy+200;
    
    rect=setx(rect,cx);
    rect=sety(rect,sy);
    
    y=gety(square);
    
    if (y > 500) y=-175;

	y = y + inc;
    
    square=sety(square,y);    
}
