질문과 답변

Extra Form

#==============================================================================
# ■ Game_Character - Jump Check
#------------------------------------------------------------------------------
#  キャラクターを扱うクラスです。このクラスは Game_Player クラスと Game_Event
# クラスのスーパークラスとして使用されます。
#==============================================================================

class Game_Character
    def jump(x_plus, y_plus)
    if x_plus.abs > y_plus.abs            # 横の距離のほうが長い
      x_plus < 0 ? turn_left : turn_right
    elsif x_plus.abs > y_plus.abs         # 縦の距離のほうが長い
      y_plus < 0 ? turn_up : turn_down
    end
    new_x = @x + x_plus
    new_y = @y + y_plus
    if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y)
    @x += x_plus
    @y += y_plus
    distance = Math.sqrt(x_plus * x_plus + y_plus * y_plus).round
    @jump_peak = 10 + distance - @move_speed
    @jump_count = @jump_peak * 2
    @stop_count = 0
    straighten
    end
  end
end



이게 점프버그를 없애는 스크립트인데 이 스크립트를 스위치를 키면 이 스크립트도 켜지고

스위치끄면 이 스크립트도 꺼져서 점프버그가 다시 생기게 하게 할수있을까요?

Comment '1'
  • profile
    습작 2012.01.18 02:21

    class Game_Character
      def jump(x_plus, y_plus)
        if x_plus.abs > y_plus.abs
          x_plus < 0 ? turn_left : turn_right
        elsif x_plus.abs > y_plus.abs
          y_plus < 0 ? turn_up : turn_down
        end
        new_x = @x + x_plus
        new_y = @y + y_plus

        if $game_switches[n] == true

          if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y)

            @x += x_plus
            @y += y_plus
            distance = Math.sqrt(x_plus * x_plus + y_plus * y_plus).round
            @jump_peak = 10 + distance - @move_speed
            @jump_count = @jump_peak * 2
            @stop_count = 0
            straighten

          end

        else

          @x += x_plus
          @y += y_plus
          distance = Math.sqrt(x_plus * x_plus + y_plus * y_plus).round
          @jump_peak = 10 + distance - @move_speed
          @jump_count = @jump_peak * 2
          @stop_count = 0
          straighten 
        end

      end
    end


    n은 사용할 스위치 번호입니다.


List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12391
RMVX ATB 스크립트 사용 중인데 상태이상에 대해 질문이 있습니다. 샛별 2012.01.14 2571
RMVX 배에 탑승시에는 몬스터와 전투 안되나요? 1 가로니 2012.01.13 2935
사이트 이용 플래시 게임 플래시 다운 2 근희 2012.01.13 2634
RMXP 퀘스트가 반복되네요. 퀘스트를 멈추는 방법좀요. 6 난몰라 2012.01.13 1762
RMVX 뱀파이어 sbabs에서 스킬 쓸 때 무기 아이콘 뜨게할 순 없나요? 닉네임은2와20 2012.01.13 2714
기타 안넹하세요~ SRPG 95 툴에 대한 몇가지 질문 몇가지 하겠습니다. 2 내가건덕 2012.01.12 2817
RMXP xp엑터 1 unuseid 2012.01.12 2689
RMVX 조건분기 오류 5 ba람이 2012.01.12 2698
GM 게임 만드는 방법좀 알려주세요...... 5 근희 2012.01.12 2720
RMXP RPG문의 2 포이즌리듬이 2012.01.11 2910
RMVX RPGVX노비타 바이오하자드 맵 1 SOUTHERNCROSS 2012.01.11 3732
RMVX 어둡게하는것 3 불량토깡 2012.01.11 2999
RMXP XP압축파일 실행오류와 스크립트에디터 한국어 부분... 1 님믹 2012.01.11 2815
RMVX 마을 이름을 바뀌게 하고 싶어요 2 가는이 2012.01.10 2860
RMVX 변수를 이용한 아이템구입 1 GTGs 2012.01.10 2186
RMVX 스위치 에따라서 스크립트 켰다 껏다 할수있을까요? 1 상생 2012.01.09 2941
RMVX 예를들어,스탯배분같은 메뉴에 원래 없던 것을 메뉴에서 없애는 법 6 쉰라면블랙 2012.01.09 2356
RMXP Rpgxp 맵칩 제작 1 미친존재감 2012.01.09 4401
RMVXA rpgvx ace전투 2 푸른초원 2012.01.09 3826
RMXP 몬스터 도감 스크립트 질문입니다 zerlo 2012.01.09 1559
Board Pagination Prev 1 ... 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 ... 516 Next
/ 516