Показать сообщение отдельно
Старый 23.09.2010, 10:36
nic233 вне форума Посмотреть профиль Отправить личное сообщение для nic233 Найти все сообщения от nic233
  № 4  
Ответить с цитированием
nic233

Регистрация: Sep 2010
Сообщений: 28
Первый фрейм
Код AS1/AS2:
mas = new Array();
for(f=0;f<1000;f++){
	mas[f]=0
}
radius1 = 50;
radius2 = 60;
angle = 0;
MouseAngle = 0;
alfa = 0;
alfa2 = 0;
us = 0;
us2 = 0;
vx1 = -100;
vx2 = 900;
vy1 = -100;
vy2 = 900;
povorot = 0;
radius = 0;
timer = 0;
timer2 = 0;
radius2 = 0;
nxt = 0;
testtop = false;
mas[0] = "";
mas[1] = "";
mas[2] = "";

Второй фрейм
Код AS1/AS2:
onEnterFrame = function () {
	ax = _xmouse;
	ay = _ymouse;
	axx = ax-ax1;
	ayy = ay-ay1;
	ax1 = ax;
	ay1 = ay;
	if ((axx>0 and ay<240) or (axx<0 and ay>240)) {
		us2 = us2+1;
	}
	if ((axx<0 and ay<240) or (axx>0 and ay>240)) {
		us2 = us2-1;
	}
	if ((ayy>0 and ax<320) or (ayy<0 and ax>320)) {
		us = us+1;
	}
	if ((ayy<0 and ax<320) or (ayy>0 and ax>320)) {
		us = us-1;
	}
	x = Math.cos(angle*Math.PI/180)*us2*2.5;
	y = Math.sin(angle*Math.PI/180)*us*2.5;
	if (us<0) {
		angle = angle-10;
	}
	if (us>0) {
		angle = angle+10;
	}
	if (angle>359) {
		angle = 0;
	}
	if (angle<0) {
		angle = 350;
	}
	ap._x = 320+x;
	ap._y = 240+y;
	newRadius = Math.sqrt(x*x+y*y);
	x = Math.cos((angle)*Math.PI/180)*newRadius;
	y = Math.sin((angle)*Math.PI/180)*newRadius;
	function direction(x1, y1, x2, y2) {
		return Math.atan2(y2-y1, x2-x1)/Math.PI*180;
	}
	if (us2>0) {
		us2 = us2-0.3;
	}
	if (us2<0) {
		us2 = us2+0.3;
	}
	if (us>0) {
		us = us-0.3;
	}
	if (us<0) {
		us = us+0.3;
	}
	if (us2>59) {
		us2 = 59;
	}
	if (us2<-59) {
		us2 = -59;
	}
	if (us>59) {
		us = 59;
	}
	if (us<-59) {
		us = -59;
	}
	if (alfa>360) {
		alfa = 0;
	}
	mbx = 320-ap._x;
	mby = 240-ap._y;
	radius = int(Math.sqrt((mbx*mbx)+(mby*mby)));
	if (timer>0 and timer2 == 1) {
		timer++;
		if (radius>radius2 and testtop == false) {
			mas[nxt*3] = timer;
			if (angle>=0) {
				mas[(nxt*3)+1] = angle;
			}
			if (angle<0) {
				mas[(nxt*3)+1] = angle*-1;
			}
			testtop = true;
		}
		if (testtop == true and radius<radius2) {
			testtop = false;
			pp = mas[(nxt*3)];
			if (pp != 0) {
				if (angle>=0) {
					mas[(nxt*3)+2] = angle;
				}
				if (angle<0) {
					mas[(nxt*3)+2] = angle*-1;
				}
				a1 = mas[nxt*3];
				a2 = mas[(nxt*3)+1];
				a3 = mas[(nxt*3)+2];
				nxt++;
				for (f=0; f<1000; f++) {
					s1 = mas[(f*3)];
					s2 = mas[(f*3)+1];
					s3 = mas[(f*3)+2];
					if (s1 == 0 and s2 == 0 and s3 == 0) {
						break;
					}
					trace(s1+"  "+s2+"  "+s3);
				}
			}
		}
	}
};
_root.onMouseDown = function() {
	if (timer>0 and timer2 == 1) {
		timer = 0;
		timer2 = 0;
		testtop = false;
	}
	if (timer == 0 and timer2 == 0) {
		timer = 1;
		timer2 = 1;
		radius2 = radius;
	}
};
stop();
Добавлено через 5 часов 14 минут
Тема не актуальна. Исходник переделал.