조회 수 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

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


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


  1. 제2회 인디사이드 게임제작대회 출품작 리스트.

    Date2016.10.24 By인디사이드운영자 Views9915 Votes0
    read more
  2. 인디사이드 활동 규정.(ver.20160119)

    Date2015.02.16 By천무 Views12006 Votes1
    read more
  3. 똥글

    Date2015.03.06 By사람님 Views52 Votes0
    Read More
  4. 후후 병맛레이스의 현황을 빨리 올려보시게 천무여 크하하핫 푸하핫

    Date2015.08.24 Byㅌㄹlove Views52 Votes0
    Read More
  5. 테시오는 보라

    Date2015.03.05 By역전 Views52 Votes0
    Read More
  6. 이 병맛스러운 3

    Date2015.08.20 By찰드 Views52 Votes0
    Read More
  7. 길드워2 다음팟 개인방송 합니다~~~

    Date2015.03.18 By양키 Views52 Votes1
    Read More
  8. [똥글 특집 + 정보글] 똥글이 범람하는 창도를 정화 ~ 1 ~

    Date2015.10.03 By쇼꿀버리 Views52 Votes0
    Read More
  9. 네코데브 로그인 시 오류 해결

    Date2015.10.29 ByRirorin Views52 Votes0
    Read More
  10. 가입인사!!!!

    Date2016.01.06 By사라케리건친구임 Views52 Votes0
    Read More
  11. 가입 후 인사드립니다.

    Date2016.01.07 ByEdmund Views52 Votes0
    Read More
  12. 조횟수레이스현황(노잼)

    Date2015.08.25 By천무 Views53 Votes0
    Read More
  13. 후루룹님 이건가여 [수정]

    Date2015.03.16 By사람님 Views53 Votes0
    Read More
  14. 사신지님 생일축전

    Date2015.08.24 By王코털 Views53 Votes1
    Read More
  15. 아.이.콘!!!!

    Date2015.03.04 By샤이귤군 Views53 Votes0
    Read More
  16. 나이들어도 늙지 않고 오히려 젊어지는(?)욕심이란...

    Date2015.04.19 By王코털 Views53 Votes0
    Read More
  17. 이스위찰도 사랑에 빠졌나훀?

    Date2015.09.29 By문챗홍위병 Views53 Votes0
    Read More
  18. 안녕하세요

    Date2015.10.03 By고양이손자 Views53 Votes0
    Read More
  19. 제가 생각하는 평가 댓글의 장/단점

    Date2015.11.19 ByRPG란무엇인가? Views53 Votes0
    Read More
  20. 이놈의 파판14 -_-

    Date2015.09.14 ByVermond Views54 Votes0
    Read More
  21. [방송예고] 레전드명작 이야기책과 대회출품 데모 방송합니다

    Date2015.09.06 By김충선_이순신_권율_신립_김시민_원균 Views54 Votes0
    Read More
  22. 지르는거 고민되네...

    Date2015.10.02 ByVermond Views54 Votes0
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 1177 Next
/ 1177






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

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