![]() |
|
||||||||||
|
|||||
|
[+1 20.08.08]
Регистрация: Aug 2008
Сообщений: 52
|
здравствуйте. боюсь что я опять с глупым вопросо, но всё же задам его.
Можно ли переменную типа, num нумеровать как мувиклипы? вот код: //Стрельба;
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;
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(lasttankrot*(Math.PI/180));
this._y += 15*Math.sin(lasttankrot*(Math.PI/180));
if (this._x>1024 || this._x<0 || this._y>678 || this._y<0) {
this.unloadMovie();
}
}
};
(наверное опять ничего не понятно? если так, то спрашивайте и я попытаюсь сказать умнее, извините меня за мой корявый язык.) |
|
|||||
|
попробуйте так
//Стрельба;
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();
}
}
};
|
|
|||||
|
[+1 20.08.08]
Регистрация: Aug 2008
Сообщений: 52
|
BBOY Ильич
большое спасибо, помогло!))) а как можно использовать Stage.width и Stage.height? извините за вопрос конечно, но всё же))) |
|
|||||
|
я так понимаю, 1024 и 678 (может все же 768?) являются размерами сцены. А что будет, если я потяну за краешек окошка? Правильно. Сцена станет больше, а цифры не изменятся... А Stage.width и Stage.height всегда будут возвращать точные размеры окна.
|
|
|||||
|
[+1 20.08.08]
Регистрация: Aug 2008
Сообщений: 52
|
BBOY Ильич
всё правильно! ещё раз спасибо большое))) |
![]() |
![]() |
Часовой пояс GMT +4, время: 07:19. |
|
|
« Предыдущая тема | Следующая тема » |
|
|