질문과 답변

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 12392
RMVX RPGVX 저장공간 1 벨리얼 2012.01.16 4695
RMVX 뱀파이어 액알에서 Die Self Switch A 어떻게 사용하는 건가요? 3 닉네임은2와20 2012.01.16 7268
RMVX XP캐릭터를 VX로 만드는거 가능한가요. 1 수정이님 2012.01.15 6368
RMVX 캐릭터의 현재 위치 기억할수 없나요? 2 가로니 2012.01.14 2486
RMVX ATB 스크립트 사용 중인데 상태이상에 대해 질문이 있습니다. 샛별 2012.01.14 2571
RMVX 배에 탑승시에는 몬스터와 전투 안되나요? 1 가로니 2012.01.13 2935
RMVX 뱀파이어 sbabs에서 스킬 쓸 때 무기 아이콘 뜨게할 순 없나요? 닉네임은2와20 2012.01.13 2714
RMVX 조건분기 오류 5 ba람이 2012.01.12 2698
RMVX RPGVX노비타 바이오하자드 맵 1 SOUTHERNCROSS 2012.01.11 3732
RMVX 어둡게하는것 3 불량토깡 2012.01.11 2999
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
RMVX 타이틀 메뉴 순서 바꾸는 방법 있나요? 1 상생 2012.01.08 2526
RMVX 아방스님께서 올려주신 액알 스크립트 말이에요..{VLAD ABS [액알 시스템]} 2 칩스 2012.01.08 3834
RMVX 죽은 엑터 시로네 2012.01.08 2515
RMVX 메뉴 화면을 스크립트로 다르게 바꾸었을 때 다른 기능 넣기 8 쉰라면블랙 2012.01.07 2365
RMVX RPGVX데미지 계산식에 대해 히나나이 2012.01.07 3277
RMVX 이거 진짜 해결이 안되네요 2 아이카 2012.01.04 2496
Board Pagination Prev 1 ... 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 ... 127 Next
/ 127