조회 수 2338 추천 수 1 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

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

단축키

Prev이전 문서

Next다음 문서

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

대각선 이동을 가능하게 하는 스크립트입니다.
(다른 기능은 없습니다)


섹션을 찾아서 붉은색 부분을 추가해주세요.


 


섹션:Game_Player


 


  #--------------------------------------------------------------------------
  # ● 프레임 갱신
  #--------------------------------------------------------------------------
  def update
    # 로컬 변수에 이동중인지 어떤지를 기억
    last_moving = moving?
    # 이동중 , 이벤트 실행중 , 이동 루트 강제중 ,
    # 메세지 윈도우 표시중의 머지않아도 아닌 경우
    unless moving? or $game_system.map_interpreter.running? or
           @move_route_forcing or $game_temp.message_window_showing
      # 방향 버튼이 밀리고 있으면 , 그 방향에 플레이어를 이동

      # 방향을 보존
      direction = @direction
      case Input.dir8
      when 1  # 좌하
        move_left
        move_down
        # 방향 고정이 아닌 경우
        unless @direction_fix
          # 오른쪽 방향이었던 경우는 왼쪽을 , 오름새였던 경우는 아래를 향하는
          @direction = (direction == 6 ? 4 : direction == 8 ? 2 : direction)
        end
      when 2  # 하
        move_down
      when 3  # 우하
        move_down
        move_right
        # 방향 고정이 아닌 경우
        unless @direction_fix
          # 좌향이었던 경우는 오른쪽을 , 오름새였던 경우는 아래를 향하는
          @direction = (direction == 4 ? 6 : direction == 8 ? 2 : direction)
        end
      when 4  # 좌
        move_left
      when 6  # 우
        move_right
      when 7  # 좌상
        move_up
        move_left
        # 방향 고정이 아닌 경우
        unless @direction_fix
          # 오른쪽 방향이었던 경우는 왼쪽을 , 하향이었던 경우는 위를 향하는
          @direction = (direction == 6 ? 4 : direction == 2 ? 8 : direction)
        end
      when 8  # 상
        move_up
      when 9  # 우상
        move_right
        move_up
        # 방향 고정이 아닌 경우
        unless @direction_fix
          # 좌향이었던 경우는 오른쪽을 , 하향이었던 경우는 위를 향하는
          @direction = (direction == 4 ? 6 : direction == 2 ? 8 : direction)
        end
      end
    end



    # 로컬 변수에 좌표를 기억
    last_real_x = @real_x
    last_real_y = @real_y
   
    ……


 


 


이것으로 완료입니다.

근데 생각보다 대각선 이동이 멋지진 않습니다.ㅡ.ㅡ;; 곧 대각선 이동시 대각선 스프라이트를 띄워 주는 스크립트가 나올지도 모르죠.(물론 나온다고 해도 모든 캐릭터의 대각선 모습을 이미지로 만들어야 한다거나 하는 노가다가 있어서 제대로 활용하는 사람이 많진 못하겠죠. 그리고 현재 본인이 알고 있는 XP의 기능으로 볼 때 대각선 그래픽 표시는 정말 귀찮을 일일 것으로 생각되는군요)

Who's 창조도시

profile

도움이 필요하면 메일이나 민원실 이용해주세요.

chunmu1@naver.com

 

 

?

  1. 한글조합입력기(영어가능)

    Date2019.11.10 CategoryRPGXP 스크립트 By조규진1 Views946 Votes0
    Read More
  2. RPG XP Xas액알

    Date2018.10.30 CategoryRPGXP 스크립트 By심심치 Views1161 Votes0
    Read More
  3. Font Setup

    Date2016.07.22 CategoryRPGXP 스크립트 By운님 Views1641 Votes0
    Read More
  4. 대화에 얼굴이 나오는 스크립트 by: killarot(네이버 dust_mite)(수정버전)

    Date2016.02.22 CategoryRPGXP 스크립트 By부초 Views2043 Votes0
    Read More
  5. RPGXP ATB전투 시스템 예제(스크립트는 예제 안에 포함)

    Date2015.11.17 CategoryRPGXP 스크립트 ByMagNesium Views870 Votes0
    Read More
  6. 스테이터스,보수,골드,플레임 타임 삭제

    Date2015.06.02 CategoryRPGXP 스크립트 Byrpgmakingbot Views847 Votes0
    Read More
  7. 헤드 업 디스플레이 스크립트

    Date2015.01.30 CategoryRPGXP 스크립트 By 운 Views958 Votes0
    Read More
  8. 컬러 비트맵 타이틀 스크립트

    Date2015.01.20 CategoryRPGXP 스크립트 By 운 Views912 Votes1
    Read More
  9. 로고 스크립트

    Date2014.12.10 CategoryRPGXP 스크립트 By 운 Views1257 Votes1
    Read More
  10. 타이틀 로딩 스크립트

    Date2014.12.07 CategoryRPGXP 스크립트 By 운 Views1148 Votes0
    Read More
  11. 타이틀 스크립트

    Date2014.12.05 CategoryRPGXP 스크립트 By 운 Views1121 Votes0
    Read More
  12. 액알 스크립트

    Date2014.11.23 CategoryRPGXP 스크립트 By커비♥ Views1527 Votes1
    Read More
  13. 공포게임에 장비착용메뉴

    Date2014.08.24 CategoryRPGXP 스크립트 By 운 Views1506 Votes0
    Read More
  14. 얼굴표시/문장을 한글자씩 나타내주는 스크립트 (출처-히페리온)

    Date2014.06.22 CategoryRPGXP 스크립트 By시르카 Views1285 Votes0
    Read More
  15. 횡스크롤 점프 [버튼허용스위치추가]

    Date2014.06.01 CategoryRPGXP 스크립트 By 운 Views1722 Votes0
    Read More
  16. 말풍선 메세지 스크립트

    Date2014.02.24 CategoryRPGXP 스크립트 By천둥번들 Views1936 Votes0
    Read More
  17. 스텟찍기스크립트

    Date2014.02.22 CategoryRPGXP 스크립트 By천둥번들 Views1920 Votes3
    Read More
  18. 달리기스크립트

    Date2014.02.22 CategoryRPGXP 스크립트 By천둥번들 Views2391 Votes2
    Read More
  19. 8방향 이동스크립트

    Date2014.02.22 CategoryRPGXP 스크립트 By천둥번들 Views1827 Votes6
    Read More
  20. AraLab_MultiStartingPoint (다중 출발점 스크립트, 캐릭터 선택 스크립트) ver.0.2beta

    Date2014.01.21 CategoryRPGXP 스크립트 By 운 Views2065 Votes1
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 Next
/ 8


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

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