질문과 답변

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 21136
RMXP 마우스 스크립트 사용할때 게임속 마우스 모양 사용하는 방법좀여. 1 오매갓 2012.01.19 2850
기타 쯔꾸르 게임 만들기 프로그램 다운법 아시는분. .? 2 Hanzo 2014.06.02 2850
RMXP 스크립트로 픽쳐표시하는법 3 석진이 2011.07.18 2851
RMXP RPGxp액알에서 스킬쓰는법질문입니다. 2 엑스칼리버 2011.09.22 2854
RMVXA VX ace 질문입니다... 1 흑마데스 2012.01.03 2859
RMVXA 스크립트 오류가 있습니다; 2 소금김밥 2012.10.01 2859
RMVX RPG만들기VX맵칩 1 아일락 2011.02.21 2860
RMVX vx 얼굴 만들기 사이트 질문이요!! 1 file daek77 2012.01.20 2861
RMXP 개촙이라몰라서 그러는데 병렬처리하고 자동실행하고 차이점이뭐죠?? 2 우카 2012.05.02 2864
RMVX 마을 이름을 바뀌게 하고 싶어요 2 가는이 2012.01.10 2867
RMVXA [rpg vx ace]타이틀 메뉴 이미지 바꾸기 2 조각조각 2014.06.22 2871
RMXP 몬스터 잡아서 동료로만들기 란란루 스튜디오 2012.04.02 2880
기타 RPG쯔꾸르 게임을 실행시팅김현상 1 흐르후꾸흐루룩 2014.04.06 2884
RMVX RPGVX 게임완성후 잠겨있는 파일 완벽한 보안방법 kallat 2012.01.01 2885
RMXP 광땡 온라인에서.. 2 VPP 2012.01.20 2886
RMVX RPG VX 맵상전투로 바꾸는방법이 뭐죠; 2 궁궐앞거지 2012.02.13 2886
RMXP xp 고수분들 답변부탁점여2 ㅠㅠ 동뼉 2012.01.08 2887
RMVX 뭐랄까.. 글씨 이벤트? 1 아이카 2011.12.31 2889
RMVX 타이틀 메뉴 추가 방법 & 타이틀 메뉴 선택 시 팝업 뜨게하는 방법 1 mihael0539 2012.01.18 2892
RMVXA ace 테스트 플레이에서 ㅠㅠ 3 file 나다니엘 renko 2012.01.03 2896
Board Pagination Prev 1 ... 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 ... 518 Next
/ 518