// psl testprogram

#define XMAX	10
#define XMIN	-10
#define BARMAX  5
#define BARMIN  -5

int tux;
int barleft;
int barright;
float x;
float zl;
float zr;
float xstep=1;
float barx;
float barxstep=1;
int main()
{
	print("Hallo Koarl\n");
	print("Hallo PSL\n");
        x=0;
	tux = getRef(12);
	barleft = getRef(6);
	barright = getRef(8);
	zl= getAttribut(barleft,"z")
	zr= getAttribut(barright,"z")
	while(1)
	{
		setPosition(tux,x,x,0,0,0,0);

		x=x+xstep;
		if( x > XMAX )
		{
			xstep = -0.1;
		}
		if( x < XMIN )
		{
			xstep = +0.1;
		}
		setPosition(barleft,-15 + barx,0,zl,0,0,0);
		setPosition(barright,15 + barx ,0,zr,0,0,0);

		barx=barx+barxstep;
		if( barx > BARMAX )
		{
			barxstep = -0.1;
		}
		if( barx < BARMIN )
		{
			barxstep = +0.1;
		}

		pause;
	}
}