XP 스크립트

8방향 갈때 8방향이동 캐릭터 없어도 됩니다.

그리고 대쉬 속도 바꿀수 있고 원래 속도도 바꿀수 있습니다.(스크립트 엄청 초반에 나옴)

 

 

 

 

 

#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/  ◆데쉬&8방향 이동 - KGC_Dash_8DirMove◆
#_/----------------------------------------------------------------------------
#_/ 맵 이동시의 데쉬&8방향 이동 기능을 추가합니다.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

#==============================================================================
# ★ 커스터마이즈 항목 ★
#==============================================================================

module KGC
  # ◆데쉬 버튼
  D8DM_DASH_BUTTON = Input::A
  # ◆데쉬 속도
  D8DM_DASH_SPEED = 5
  # ◆보행 속도
  D8DM_WALK_SPEED = 4
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Game_System
#==============================================================================

class Game_System
 #--------------------------------------------------------------------------
 # ● 공개 인스턴스 변수
 #--------------------------------------------------------------------------
  attr_accessor :dash_permit              # 데쉬 허가 플래그
  attr_accessor :dir8_permit              # 8방향 이동 허가 플래그
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #--------------------------------------------------------------------------
  alias initialize_KGC_Dash_8DirMove initialize
  def initialize
   # 원래의 처리를 실행
    initialize_KGC_Dash_8DirMove

    @dash_permit, @dir8_permit = true, true
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Game_Player
#==============================================================================

class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # ● フレ?ム更新
  #--------------------------------------------------------------------------
  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
      # 方向ボタンが押されていれば、その方向へプレイヤ?を移動
      if $game_system.dir8_permit
        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
      else
        case Input.dir4
        when 2
          move_down
        when 4
          move_left
        when 6
          move_right
        when 8
          move_up
        end
      end

      # ダッシュが許可されており、かつダッシュボタンが押されている場合
      if $game_system.dash_permit && Input.press?(KGC::D8DM_DASH_BUTTON)
        # ダッシュ速度に?更
        @move_speed = KGC::D8DM_DASH_SPEED
      else
        # ?行速度に?更
        @move_speed = KGC::D8DM_WALK_SPEED
      end
    end
    # ロ?カル??に座標を記憶
    last_real_x = @real_x
    last_real_y = @real_y
    super
    # キャラクタ?が下に移動し、かつ?面上の位置が中央より下の場合
    if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
      # マップを下にスクロ?ル
      $game_map.scroll_down(@real_y - last_real_y)
    end
    # キャラクタ?が左に移動し、かつ?面上の位置が中央より左の場合
    if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
      # マップを左にスクロ?ル
      $game_map.scroll_left(last_real_x - @real_x)
    end
    # キャラクタ?が右に移動し、かつ?面上の位置が中央より右の場合
    if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
      # マップを右にスクロ?ル
      $game_map.scroll_right(@real_x - last_real_x)
    end
    # キャラクタ?が上に移動し、かつ?面上の位置が中央より上の場合
    if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
      # マップを上にスクロ?ル
      $game_map.scroll_up(last_real_y - @real_y)
    end
    # 移動中ではない場合
    unless moving?
      # 前回プレイヤ?が移動中だった場合
      if last_moving
        # 同位置のイベントとの接?によるイベント起動判定
        result = check_event_trigger_here([1,2])
        # 起動したイベントがない場合
        if result == false
          # デバッグモ?ドが ON かつ CTRL キ?が押されている場合を除き
          unless $DEBUG and Input.press?(Input::CTRL)
            # エンカウント カウントダウン
            if @encounter_count > 0
              @encounter_count -= 1
            end
          end
        end
      end
      # C 버튼이 밀렸을 경우
      if Input.trigger?(Input::C)
        # 同位置および正面のイベント起動判定
        check_event_trigger_here([0])
        check_event_trigger_there([0,1,2])
      end
    end
  end
end

 

 

 

중복이면 바로 삭제하겠습니다.

Who's WinHouse

?

Oh, I'm So Boring!

Comment '63'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
1021 아이템 흠..몬스터도감말고 아이템도감~ 9 백호 2009.02.21 2028
1020 전투 흠.. 아직도 이 스크립트가 없군요 ㅋㅋ(제가올림..) 1 file 백호 2009.02.21 3335
1019 전투 횡스크롤형식의 스크립트 7 백호 2009.02.21 2960
1018 기타 횡스크롤 스크립트 한국말 번역. 15 file 백호 2009.02.21 3311
1017 기타 회복으로 데미지를 받는 좀비 스크립트 7 백호 2009.02.22 2004
1016 메뉴 화살표 모양 셀렉트 커서 사용 2 백호 2009.02.22 2118
1015 그래픽 화면을 부드럽게 해주는스크립트[ 아주 유용] 56 file - 하늘 - 2009.08.05 6561
1014 미니맵 화면에 축소된 미니맵을 표시하는 스크립트 - 한글 번역 - 6 file 백호 2009.02.21 2559
1013 화면에 축소된 맵을 표시하는 스크립트 7 file 백호 2009.02.21 2394
1012 기타 홈페이지 띄우기 (VX 상관없음.) 6 KNAVE 2009.08.25 2137
1011 메뉴 혹시있나해서-_-.. 대화창에 테두리치기 스크립트 7 백호 2009.02.22 2591
1010 기타 현재시간표시 33 file 코아 코스튬 2010.10.09 2528
1009 기타 현재 맵BGM을 그대로 전투 BGM으로 연결 from phylomortis.com 백호 2009.02.22 1180
1008 이름입력 한글조합입력기(영어가능) file 조규진1 2019.11.10 492
1007 메시지 한글자씩 뜨는 스크립트 6 백호 2009.02.21 2999
1006 키입력 한글입력스크립트 16 file 아방스 2007.11.09 11823
1005 키입력 한글입력기(자음, 모음 분리. 아마 중복일 듯...) 11 캉쿤 2011.09.13 3225
1004 키입력 한글입력기 6 백호 2009.02.22 4297
1003 이름입력 한글이름 입력기 스크립트 14 백호 2009.02.22 4205
1002 메시지 한글 채팅 스크립트 32 file こなた 2009.01.22 4947
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 52 Next
/ 52