閲覧数 410 推奨数 0 コメント 4
Atachment
添付 '2'
?

Shortcut

Prev前へ 書き込み

Next次へ 書き込み

Larger Font Smaller Font 上へ 下へ Go comment 印刷
?

Shortcut

Prev前へ 書き込み

Next次へ 書き込み

Larger Font Smaller Font 上へ 下へ Go comment 印刷

+_+??





?
  • 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인디사이드운영자 Views54720 Votes0
    read more
  2. 인디사이드 활동 규정.(ver.20160119)

    Date2015.02.16 By천무 Views57342 Votes1
    read more
  3. 여기서 하시면 되겠습니다

    Date2026.06.27 By우쭈앙 Views85 Votes0
    Read More
  4. 국내 최대 규모의 Unity 개발자 컨퍼런스, Unite Seoul 2026 개최

    Date2026.06.09 By안녕하세요3 Views176 Votes0
    Read More
  5. 🕹️'2026 인디크래프트' 출품작 모집 기한 연장! (5/11까지)🕹️

    Date2026.04.23 By인디크래프트사무국26 Views539 Votes0
    Read More
  6. 나 이하나인데 여기 보스 나와라

    Date2026.04.18 By루나라 Views518 Votes0
    Read More
  7. 대한민국 대표 인디게임 축제, '2026 인디크래프트' 출품작 절찬 모집중! (5/6까지)

    Date2026.04.16 By인디크래프트사무국26 Views505 Votes0
    Read More
  8. 2026 인디크래프트 출품작 모집 공고 [국내/커뮤니티/챌린저부문]

    Date2026.04.06 By인디크래프트사무국26 Views674 Votes0
    Read More
  9. 글 쓰려다가 데모/체험판 게임이 사라진거 같은데

    Date2026.04.05 ByUSA준 Views558 Votes0
    Read More
  10. 혹시 '이터니티' 라는게임 갖고 계시는분 있을까요?

    Date2026.02.01 ByDoingDogu Views1135 Votes0
    Read More
  11. [스마일게이트 퓨처랩] 비버롹스 2025 온라인 전시관 오픈! (12/1~12/14)

    Date2025.12.01 By스마일게이트퓨처랩 Views959 Votes0
    Read More
  12. [스마일게이트 퓨처랩] 비버롹스 with 산나비! 게임 시연과 함께 굿즈 스토어까지!

    Date2025.11.26 By스마일게이트퓨처랩 Views964 Votes0
    Read More
  13. [스마일게이트 퓨처랩] 놓치면 후회! 비버롹스 2차 얼리버드 티켓 절찬 판매중!

    Date2025.11.20 By스마일게이트퓨처랩 Views919 Votes0
    Read More
  14. 코리아 인디게임 쇼케이스가 떴다

    Date2025.10.20 Bygls2024 Views984 Votes0
    Read More
  15. GGDC 2025 글로벌게임개발자컨퍼런스 2차 공개!

    Date2025.10.18 Byggdc Views932 Votes0
    Read More
  16. BEAVER ROCKS 2025 슈퍼 얼리버드 티켓 오픈!

    Date2025.10.17 By스마일게이트퓨처랩 Views911 Votes0
    Read More
  17. 이제 여기 다운로드는 다 막힌건가

    Date2025.10.12 ByRedgm Views1281 Votes0
    Read More
  18. 안녕하세요

    Date2025.09.30 By우사준 Views1044 Votes0
    Read More
  19. 혹시 이 사이트의 등업관련해서 질문이있는데요

    Date2025.09.23 By이드냐 Views1197 Votes0
    Read More
  20. GGDC 2025 글로벌 게임 개발자 컨퍼런스

    Date2025.09.18 Byggdc Views1416 Votes0
    Read More
  21. NGC2025 사전등록 이벤트 소식~ ^^

    Date2025.09.18 By태사자 Views1014 Votes0
    Read More
  22. [대구디지털혁신진흥원] (NGC2025) NEXT GAME CONFERENCE 2025

    Date2025.09.12 By태사자 Views1043 Votes0
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 1178 Next
/ 1178