질문과 답변

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 12393
RMVX 스크립트 쓸때 alias 1 EuclidE 2011.10.15 1561
RMVX 스크립트 사용시 등록된 데이터의 초기화 톨톨 2015.06.08 153
RMVX 스크립트 불러오기 1 돈돈치 2011.07.23 1029
RMVX 스크립트 문의 2 용발2 2011.03.02 707
RMVX 스크립트 문의 1 何異 2011.08.05 1466
RMVX 스크립트 몇줄부터 충돌 아방스의강좌 2011.04.14 1108
RMVX 스크립트 만들때! 1 김효도 2011.08.25 1491
RMVX 스크립트 두개를 합쳐주실 수 있나요? file KAHP 2015.12.15 167
RMVX 스크립트 관련 질문하나 할게요 ㅠ file 7455 2014.12.04 246
RMVX 스크립트 관련 질문입니다. 3 녹색주머니 2010.10.16 745
RMVX 스크립트 관련 질문 드립니다 1 씡난다 2011.12.24 1898
RMVX 스크립트 고수분들 질문 합니다 !!! 7 file 생수 2011.12.31 2350
RMVX 스크립트 게시판의 "액터선택지 간편제작 스크립트 오류"에 대해.. 5 츠코미 2010.11.04 1051
RMVX 스크립트 syntax error 문제 1 dcbuzz 2010.09.13 1662
RMVX 스크립트 Cache에서 75Line 오류가 뜨네요 정말귀인★ 2012.02.06 1784
RMVX 스크립트 (사이드뷰 어택 스크립트) 질문이요. 원의마인크래프트 2013.09.07 1037
RMVX 스위치를 켜야하는데 루프가 계속돌아가서 2 원숭이목욕탕 2013.04.15 883
RMVX 스위치를 이용한 데미지 공식 변경 스크립트 2 딸기뱀 2012.02.03 2414
RMVX 스위치가 켜지면 나타나는 캐릭터 1 휴론 2014.11.19 368
RMVX 스위치 에따라서 스크립트 켰다 껏다 할수있을까요? 1 상생 2012.01.09 2941
Board Pagination Prev 1 ... 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 ... 127 Next
/ 127