질문과 답변

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 12451
RMXP 미니맵 스위치 제발좀 도와주세요 4 황제님 2010.10.08 600
RMXP 아주어려운질문이에요.ㅜㅜㅜ 1 나는청춘 2010.10.08 663
RMVX 변수1과 변수2를 변수3에 대입하기 7 곰테니 2010.10.09 698
RM2k 랄라라~ 오랜만에 질문좀 하나 할께요~ (Nameless) 2010.10.09 997
RMVX 맵 장소이동 시 이벤트 위치 초기화 되는 문제 1 명상합시다 2010.10.09 851
RMXP 액알 만드는 법 1 좋은사람a 2010.10.09 955
RMXP 링메뉴에서 스테이터스를 "완전히!"제거하고 싶은데 어떻게 하죠? 2 츠키-★ 2010.10.09 865
RMVX 열쇠를 사용하고나서는 열쇠가필요하다는말이뜨지않게 어떻게하죠 2 프라임헌터즈 2010.10.09 839
RMVX 바다위를 랜덤으로 움직이는 배.. 5 난천 2010.10.09 848
RMXP 시작하자마자 혼자 생각하는걸 만들고 싶은데요 3 수야 2010.10.09 876
기타 아프리카 방송을시작하려는데요.. 4 나여 2010.10.10 1587
RM2k3 RPG2003 을 다운했는데 4 프라임헌터즈 2010.10.10 2007
RMVX 사이드뷰 3.4 + ATB 1.2 버전 몬스터 4 하늘풍선 2010.10.12 978
RMXP 시작하자마자 대화창이 떠서 미치겠는데.. 4 수야 2010.10.12 780
RMVX 몇가지 궁금한 점 좀 알려주세요. 2 아타락시아 2010.10.12 702
기타 온라인rpg게임 어떻게 만듬? 2 Cail Arial 2010.10.13 1804
RMVX 타이틀에 궁금한게 있는데 4 파이어 2010.10.13 795
RMVX Rpg Vx 렉 방지하는 법좀, 최적화 하는 법좀;; 4 명상합시다 2010.10.13 4028
RMXP 퀘스트만드는법 2 게임초초초초봉 2010.10.13 1001
RMXP 스크립트 아시는분들 이부분 해석좀 해주세요 5 EE!! 2010.10.14 604
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 516 Next
/ 516