커뮤니티로 돌아가기

대화

김써니님의 글에서 이어진 답글 0개

김
김써니@hae3001

[good] 내가 만든 가속액션 ㅇㅇ 내가 만든거임 걍 심심해서 생각남ㅇㅇ =================================================================== onClipEvent(load){//초기 변수설정 _root.speed = 0; _root.speed1 = 0; } onClipEvent(enterFrame){ if(Key.isDown(Key.LEFT)){//왼쪽키를 누르면 _root.speed +=0.1;//스피드는+0.1 더빨리 하고 싶으면 값올리세요 this._x -=_root.speed;//마찬가지 왼쪽으로 스프드 만큼 간다는거임 }else{//아닐경우 즉 키를 안누를떄 this._x -=_root.speed;//이것의 x-= 스피드 _root.speed -= 0.1;//스피는드는 - 0.1 이걸 올리면 빨리멈춤 } } onClipEvent(enterFrame){ if(Key.isDown(Key.RIGHT)){//마찬가지 _root.speed1 +=0.1; this._x +=_root.speed1; }else{ this._x +=_root.speed1; _root.speed1 -= 0.1; } } //여기서 부터 옵션 //스피드 코과수 올리면 가속이 더붙음ㅇㅇ onClipEvent(enterFrame){//스피드 제한임ㅇㅇ if(_root.speed>10){//스피드가 10 초과하면 _root.speed = 10;//스피드는 0 }else if(_root.speed 10){ _root.speed1 = 10; }else if(_root.speed1 550||this._x 400||this._y<0){//쉽게말해 550*400 크기의 스테이지를 나가면 this._x = 275;//이것의 x= 275 this._y = 200;//아것의 x= 200 //고로 중간임ㅇㅇ } } //옵션을 원하지 않을 경우 지워도 됨ㅇㅇ //그리고 상하는 알아서 하삼