무비클립안의 duplicate 발동이 안돼네요;
딥보라
duplicate를 발동해서 스킬시전이 됐을때
별이 막 사방으로 랜덤하게 분사가 되는 것을 보고 싶었는데요;;
띡~ 하나만 날아가고 마네요;;
중앙무비클립안의 액션스크립:
onClipEvent (load) {
//별 복사를 위한 변수1일때 발동
starcopy = 0;
//a는 별 복사 단계를 위한 변수
a = 0;
//b는 별복사했을때 star뒤에 붙여줄 구분수
b = 0;
}
onClipEvent (enterFrame) {
//현재 마우스 좌표와의 거리
hi = _root._ymouse-_y;
wd = _root._xmouse-_x;
//미리 클릭해둔 마우스 좌표와의 거리
hi2 = _root.cursory-_y;
wd2 = _root.cursorx-_x;
//현재 마우스 좌표와의 각
rota = Math.atan2(hi, wd);
//미리 클릭해둔 마우스 좌표와의 각
rotb = Math.atan2(hi2, wd2);
this._x = _root.unit._x;
this._y = _root.unit._y;
//여기서부터가;; 모르겠습니다; 왜 복사가 안되는지;ㅅ;
//스타카피 발동
if (starcopy == 1) {
//a에 1을 더해주고
a += 1;
if (a == 1) {
b+=1
duplicateMovieClip(_root.star, star add b, b);
_root[star+b]._x = _root.unit._x;
_root[star+b]._y = _root.unit._y;
_root[star+b]._rotation = Math.random(360);
}
} else {
//엔터프레임이라 어차피 계속 루프되니깐 a값이 계속 커지는 걸 막으려구 이렇게 했구요
a = 0;
}
//키를 떼었을경우
if (Key.UP) {
if (_root.action == 3 and _root.i == 1 and _root.keyon == 1) {
this.gotoAndStop(2);
tm1 = getTimer();
_rotation = rotb/(Math.PI/180);
}// 이 경우에 별흩뿌리기 스킬이 발동되는 겁니다
if (_root.action == 3 and _root.i == 2 and _root.keyon == 1) {
this.gotoAndStop(3);
//별카피 발동
starcopy = 1;
tm2 = getTimer();
}
}
// 현재 베기 스킬중일때
if (this._currentframe == 2) {
// 0.1초후에 1프레임으로 가라
if (getTimer()-tm1=100) {
//1프레임은 스킬無시전중일 경우입니다.
this.gotoAndStop(1);
}
}
//현재 별흩뿌리기 스킬중일때
if (this._currentframe == 3) {
//2초후에
if (getTimer()-tm2=2000) {
//별흩뿌리기 스킬 끔
starcopy = 0;
this.gotoAndStop(1);
}
}
}
별의 액션 스크립: 인스턴트네임(star)
onClipEvent (enterFrame) {
xp=_root.unit._x-_x
yp=_root.unit._y-_y
direct=Math.sqrt((xp*xp)+(yp*yp))
this._x+=10
if (direct80) {
removeMovieClip(this);
}
}도대체가 왜 ㅠㅠ