// spl testprogram

var tmpvec = new Vector(0,0,0);

var objects = [
	tux: [
		qco: new QCO(12),
		cycles: 200,
		counter: 100,
		step: new Vector(0.1, 0.1, 0),
		state: 1
	],
	bar_left: [
		qco: new QCO(6),
		cycles: 100,
		counter: 50,
		step: new Vector(0.1, 0, 0),
		state: 1
	],
	bar_right: [
		qco: new QCO(8),
		cycles: 100,
		counter: 50,
		step: new Vector(0.1, 0, 0),
		state: 1
	]
];

while (1)
{
	foreach object_id (objects) {
		var o = objects[object_id];
		
		if ( o.state ) {
			o.qco.setpos( o.qco.getpos() (+) o.step );
			if ( o.counter < o.cycles )
				o.counter++;
			else
				o.state = 0;
		} else {
			o.qco.setpos( o.qco.getpos() (-) o.step );
			if ( o.counter > 0 )
				o.counter--;
			else
				o.state = 1;
		}
	}
	freeze();
}
