조회 수 53 추천 수 0 댓글 4
Atachment
첨부 '2'
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

+_+??





?
  • profile
    후루룹쩝쩝 2015.03.16 18:57
    그 반대 입니다..... 까여나가는 거죠
  • profile
    사람님 2015.03.16 18:59

    코드


    package {

    import flash.display.MovieClip;
    import flash.geom.Point;
    import flash.events.Event;


       public class Main extends MovieClip {

          private var p1: Point;
          private var p2: Point;
          private var progress: Number = 0;

          private var points: Array;
          private var index: int = 0;

          // 생성자
          public function Main() {
             addEventListener(Event.ADDED_TO_STAGE, Start);
          }

          // 초기화합니다.
          private function Start(e: Event): void {
             removeEventListener(Event.ADDED_TO_STAGE, Start);

             // 드로잉에 필요한 꼭지점들을 배열로 가지고 있습니다.
             points = new Array();
             points.push(new Point(stage.stageWidth / 2, 0));
             points.push(new Point(stage.stageWidth, 0));
             points.push(new Point(stage.stageWidth, stage.stageHeight / 2));
             points.push(new Point(stage.stageWidth, stage.stageHeight));
             points.push(new Point(stage.stageWidth / 2, stage.stageHeight));
             points.push(new Point(0, stage.stageHeight));
             points.push(new Point(0, stage.stageHeight / 2));
             points.push(new Point(0, 0));
             points.push(new Point(stage.stageWidth / 2, 0));

             // 0번째 점이 시작점입니다.

             // 다음 점을 구하는 함수를 만듭니다.

             // 다음 점을 구할 때마다 인덱스를 1씩 증가시킵니다.
             p1 = points[0];
             p2 = nextPoint();

             addEventListener(Event.ENTER_FRAME, Update);
          }

          // 시간이 업데이트될 때마다 호출됩니다.
          private function Update(e: Event): void {

             // 진행도를 0.01 늘립니다. 진행도는 매 꼭지점마다 0~1사이의 값이 됩니다.
             progress += 0.01;

             // 이전프레임에서 그린 그래픽을 제거합니다.
             graphics.clear();

             graphics.beginFill(0xff0000, 0.5);

             // 스테이지 중심점에서 그리기시작합니다.
             graphics.moveTo(stage.stageWidth / 2, stage.stageHeight / 2);

             // index까지 그려줍니다.
             for (var i: int = 0; i < index; i++) {
                graphics.lineTo(points[i].x, points[i].y);
             }

             // 진행도만큼 그려줍니다.
             graphics.lineTo(p1.x, p1.y);
             graphics.lineTo(p2.x * progress + p1.x * (1 - progress), p2.y * progress + p1.y * (1 - progress));

            // 진행도가 1 이상이 되면 0으로 바꾸어주고 드로잉할 다음 점을 구합니다.

            // 전체의 진행도는 (index+progress)/점 배열 길이로 구할 수 있습니다.
             if (progress >= 1) {
                progress = 0;
                p1 = p2;
                p2 = nextPoint();
                if (p2 == null) {
                   removeEventListener(Event.ENTER_FRAME, Update);

                  // 다음 점이 없으면 쿨 타임이 완료된 것입니다.
                   // DO SOMETHING !
                }
             }
          }

          // 인덱스를 1 늘리고 다음 점을 구합니다.
          private function nextPoint(): Point {
             index++;

             if (index == points.length) {
                return null;
             }

             return points[index];
          }

       }

    }

  • profile
    사람님 2015.03.16 19:02
    헐 탭 다 날라가버리네;;
  • profile
    후루룹쩝쩝 2015.03.16 20:31

    이해를 못하셨나보군.... 역시..;;


    그냥 제가 될 때까지 해보죠 뭐;


List of Articles
번호 제목 글쓴이 날짜 조회 수 추천 수
공지 제2회 인디사이드 게임제작대회 출품작 리스트. 189 인디사이드운영자 2016.10.24 9908 0
공지 인디사이드 활동 규정.(ver.20160119) 192 천무 2015.02.16 11999 1
23383 오케스트라 - FF 메인테마 / DQ 서곡 3 Evangelista 2009.02.22 720 5
23382 레프트 7 스타 5 블랙포그 2009.01.18 899 5
23381 내가 직접 만든 초절정 깜찍 동물들 5 ghews 2009.01.14 774 5
23380 예수의 가르침 12 새턴인DAN 2010.11.28 436 5
23379 레알 추억의 과자 5 file ThePromise 2010.11.04 320 5
23378 안경닦기류 최강 5 file S.J.Rush 2010.11.03 338 5
23377 관찰력류 최강 7 file S.J.Rush 2010.11.03 339 5
23376 이들에겐 공통점이 있다... 그것은 D !! 13 file 작은영웅 2010.10.24 429 5
23375 이거시 군대다 10 file ThePromise 2010.10.20 464 5
23374 LG로고의 비밀 5 file ThePromise 2010.10.19 653 5
23373 파워덕후 7 file ThePromise 2010.10.17 469 5
23372 문명할려고 다운받앗는게 이게 뭥미 7 file 여노 2010.10.17 415 5
23371 지구촌 화합 13 금목걸이 2010.10.14 416 5
23370 지역드립 8 file 빛나는콧수염 2010.10.03 393 5
23369 양키들이 페이스북에서 이러고 놈 ㅋ 9 file 빛나는콧수염 2010.09.26 410 5
23368 대구 중학교 흉기사건 7 루넨스 2010.09.20 768 5
23367 남조선의 위엄 3 file ThePromise 2010.09.11 624 5
23366 소트라이더 3 file ThePromise 2010.09.11 411 5
23365 이성에게 차이고 난 후 반응은? 8 file ThePromise 2010.09.10 572 5
23364 [충격, 공포주의] 대학생 되면 좋을 줄 알죠? 18 file 양민기타 2010.08.30 474 5
Board Pagination Prev 1 ... 3 4 5 6 7 8 9 10 11 12 ... 1177 Next
/ 1177






[개인정보취급방침] | [이용약관] | [제휴문의] | [후원창구] | [인디사이드연혁]

Copyright © 1999 - 2016 INdiSide.com/(주)씨엘쓰리디 All Rights Reserved.
인디사이드 운영자 : 천무(이지선) | kernys(김원배) | 사신지(김병국)