Показать сообщение отдельно
Старый 26.08.2008, 21:10
BBOY Ильич вне форума Посмотреть профиль Отправить личное сообщение для BBOY Ильич Найти все сообщения от BBOY Ильич
  № 2  
Ответить с цитированием
BBOY Ильич
 
Аватар для BBOY Ильич

Регистрация: Nov 2007
Сообщений: 256
Записей в блоге: 1
Отправить сообщение для BBOY Ильич с помощью ICQ
попробуйте так
Код:
//Стрельба;
	if (Key.isDown(Key.SPACE)) {
		shootreload++;
		if (shootreload>=_global.shootreload) {
			plazmanum += 1;
			_root.attachMovie("PlazmaShip", "PlazmaShip"+plazmanum, this.getNextHighestDepth(), {_x:tank._x, _y:tank._y});
			_root["PlazmaShip"+plazmanum]._rotation = tank._rotation;
			_root["PlazmaShip"+plazmanum].gotoAndPlay(2);
			shootreload = 0;
			_root["PlazmaShip"+plazmanum].lasttankrot = tank._rotation;
		}
	} else {
		shootreload = 10;
	}
	_root["PlazmaShip"+plazmanum].onEnterFrame = function() {
		if (this._currentframe<5) {
			this._rotation = tank._rotation;
			this._x = tank._x;
			this._y = tank._y;
		} else {
			this._x += 15*Math.cos(this.lasttankrot*(Math.PI/180));
			this._y += 15*Math.sin(this.lasttankrot*(Math.PI/180));
			if (this._x>1024 || this._x<0 || this._y>678 || this._y<0) {
				this.unloadMovie();
			}
		}
	};
Код:
if (this._x>1024 || this._x<0 || this._y>678 || this._y<0) {
может все-таки лучше использовать Stage.width и Stage.height?