질문과 답변

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 12450
RMVX RGSS202.dll좀 주실분 2 알피지매니아스 2010.11.14 10518
RMVX RVDATA2 파일은 어떤 프로그램으로 열어야하나요? 2 글쓰니안쓰니 2013.03.28 10133
RMVX rpgvx계 게임을 받았는데 1 하구하구 2010.11.08 9686
RMVX 대화창 스킵하는법 6 kaisis 2013.05.06 8721
RMVX RGSS202E.dll 이 없어요.. 어디서 구하죠? 2 C1님 2011.04.18 8103
RMVX RPGVX 오류(?) 2 『호┠심』군 2010.12.01 8061
RMVX 뱀파이어 액알에서 Die Self Switch A 어떻게 사용하는 건가요? 3 닉네임은2와20 2012.01.16 7269
RMVX 애니메이션 한 프레임당 초가 몇인지 알고싶습니다. 4 톰소여동생 2012.06.29 7185
RMVX XP캐릭터를 VX로 만드는거 가능한가요. 1 수정이님 2012.01.15 6368
RMVX 처음 게임을 시작하자마자 바로이벤트 시작은 어떻게하나요?? 3 WOL 2012.11.18 6294
RMVX rpgvx질문 2 딩소앙 2010.09.08 6233
RMVX 초기화 후 두번째 질문!!(타일셋a1 원본 찾는법) 6 dcbuzz 2010.09.07 5922
RMVX RPGVX 폰트(글씨체) 스크립트 어디서 어떻게 바꾸나요? 4 미라클 2011.07.16 5820
RMVX 퀘스트를 만드려는데 4 play 2010.09.07 5486
RMVX 타일셋 안나오네요;;; 3 끼룩 2010.09.07 5169
RMVX 스크립트 오류요... 5 여유로운하루 2010.09.07 5089
RMVX 체력 수치로 조건분기 하는 법. 1 카프리강 2012.10.02 4852
RMVX 그림 띄웠을때 그림 고정시키는 방법이..? 5 dcbuzz 2010.09.08 4834
RMVX 탱커를 만들수는 없나요? 3 류한서 2012.11.19 4821
RMVX 티스토리에 있는 짤린 스크립트들 복구 안되나요? 2 dcbuzz 2010.09.09 4722
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 127 Next
/ 127