{
	FUNC["fill_stay"]=
	{
		_col0_r = GetParam( _line, "Color0", CurTime(), 0 );
		_col0_g = GetParam( _line, "Color0", CurTime(), 1 );
		_col0_b = GetParam( _line, "Color0", CurTime(), 2 );
		_draw1 = FillColor( _img_text, _col0_r, _col0_g, _col0_b );
		CurKara( _line, _kara );
		_ce = range(CurLineStart+TimePerKara*_kara+TimePerKara,CurLineStart,CurKaraStart);
		_cs = _ce - TimePerKara*3;
		_a = (CurTime() - _cs)/(_ce-_cs);
		_a = range( _a, 0, 1 );
		DrawFinal( _draw1, _posx, _posy, 100, 100*_a, range(_a*3,0,1) );
		LineY=_posy;
	}
	FUNC["bouncer_emit"]=
	{
		Emit( "bouncer", CurKaraStart, CurKaraEnd+10, CurLine, CurKara, CurChar );
	}

	FUNC["perKara_fill"]=
	{
		SharpForErrors(1);
		Emit( "fill_stay", CurLineStart, CurKaraStart, CurLine, CurKara, -1 );
		Emit( "fill_explo", CurKaraStart-oneframe, CurKaraStart, CurLine, CurKara, -1 );
		EnumChars( "bouncer_emit", CurLine, CurKara );
		LineHeight=CurKaraSizeY;
	}


	FUNC["border_stay"]=
	{
		_col2_r = GetParam( _line, "Color2", CurTime(), 0 );
		_col2_g = GetParam( _line, "Color2", CurTime(), 1 );
		_col2_b = GetParam( _line, "Color2", CurTime(), 2 );
		_draw2 = FillColor( _img_border, _col2_r, _col2_g, _col2_b );
		CurKara( _line, _kara );
		_ce = range(CurLineStart+TimePerKara*_kara,CurLineStart,CurKaraStart);
		_cs = _ce - TimePerKara*3;
		_a = (CurTime() - _cs)/(_ce-_cs);
		_a = range( _a, 0, 1 );
		DrawFinal( _draw2, _posx, _posy, 100, 100, _a );
	}
	FUNC["perKara_border"]=
	{
		SharpForErrors(1);
		Emit( "border_stay", CurLineStart, CurKaraStart, CurLine, CurKara, -1 );
	}


	FUNC["perLine"]=
	{
		EnumKaras( "perKara_border", CurLine );
		EnumKaras( "perKara_fill", CurLine );
	}

	FUNC["fill_explo"]=
	{
		_col0_r = GetParam( _line, "Color0", CurTime(), 0 );
		_col0_g = GetParam( _line, "Color0", CurTime(), 1 );
		_col0_b = GetParam( _line, "Color0", CurTime(), 2 );
		_draw1 = FillColor( _img_text, _col0_r, _col0_g, _col0_b );

		_col2_r = GetParam( _line, "Color2", CurTime(), 0 );
		_col2_g = GetParam( _line, "Color2", CurTime(), 1 );
		_col2_b = GetParam( _line, "Color2", CurTime(), 2 );
		_draw2 = FillColor( _img_text, _col2_r, _col2_g, _col2_b );

		GenParticleFx( "fill_explo", _draw2, 0, _posx, _posy, 0.05, 0.3, 0 );
		GenParticleFx( "fill_explo", _draw1, 0, _posx, _posy, 0.1, 1.0, 0 );

		ParticleForce( "fill_explo", _posx+rand(-10,10), _posy+rand(-20,20), 10, 0.3 );
		ParticleForce( "fill_explo", _posx+rand(-20,10), _posy+rand(-10,20), 10, 0.3 );
		ParticleForce( "fill_explo", _posx+rand(-10,20), _posy+rand(-20,10), 10, 0.3 );
		ParticleForce( "fill_explo", _posx+rand(-20,20), _posy+rand(-20,20), 10, 0.3 );
	}

	FUNC["bouncer"]=
	{
		if( CompEqual(-1,_binvis ) )
		{
			_col0_r = GetParam( _line, "Color0", CurTime(), 0 );
			_col0_g = GetParam( _line, "Color0", CurTime(), 1 );
			_col0_b = GetParam( _line, "Color0", CurTime(), 2 );
			_draw1 = FillColor( _img_text, _col0_r, _col0_g, _col0_b );

			_col2_r = GetParam( _line, "Color2", CurTime(), 0 );
			_col2_g = GetParam( _line, "Color2", CurTime(), 1 );
			_col2_b = GetParam( _line, "Color2", CurTime(), 2 );
			_draw2 = FillColor( _img_border, _col2_r, _col2_g, _col2_b );

			if( CompEqual( _velx, -1 ) )
			{
				_velx=rand(-10,00)*0.5;
				_vely=- rand(10,20)*6;
			}
			else
			{
				_posx=_posx + _velx;
				_posy=_posy + _vely;
			}

			_vely=_vely+0.8;

			CurKara( _line, _kara );

			_sqeeze =_sqeeze - 0.2;
			_grenz = LineY+LineHeight*0.0;
			if( CompGreater( _posy, _grenz ) )
			{
				if( CompGreater( CurKaraEnd,CurTime() ) )
				{
					_sqeeze = _vely *0.3 ;
					_posy=_grenz;
					_vely=-_vely*1.7;
					CallFunc( "fill_explo" );
					EmitterAlpha( "fill_explo", 0.5 );
				}
				else
				{
					re=2;
					_alpha = _alpha - 0.1;
				}

				if( CompGreater(-2,_alpha) )
				{
					_binvis=1;
				}

			}

			_sqeeze = range( _sqeeze, 0, 1 );
			DrawFinal( _draw2, _posx, _posy, 100, 100 - _sqeeze*100*0.5, _alpha+2 );
			DrawFinal( _draw1, _posx, _posy, 100, 100 - _sqeeze*100*0.5, _alpha+2 );


//leave a trail
			_fnam = "bouncer_l_" + _line;
			_fnam = _fnam + "_k_";
			_fnam = _fnam + _kara;
			_draw1 = ImgRescale( _draw1, 5, 5 );
			_draw2 = ImgRescale( _draw2, 5, 5 );
			GenParticleFx( _fnam, _draw2, 0, _posx, _posy, 0.03, 1, 0 );
			GenParticleFx( _fnam, _draw1, 0, _posx, _posy, 0.01, 1, 0 );
			EmitterAlpha( _fnam, 0.1 );

			ParticleForce( _fnam, _posx+rand(-10,10), _posy+rand(-20,20), 10, 0.3 );
			ParticleForce( _fnam, _posx+rand(-20,10), _posy+rand(-10,20), 10, 0.3 );
			ParticleForce( _fnam, _posx+rand(-10,20), _posy+rand(-20,10), 10, 0.3 );
			ParticleForce( _fnam, _posx+rand(-20,20), _posy+rand(-20,20), 10, 0.3 );

		}
	}










	TimePerKara = 0.1;
	EnumLines( "perLine" );


}