질문과 답변

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 21134
RMVX <뒤따라오는 이벤트가 특정이벤트와 접촉하면 이 이벤트실행>만드는것좀 도와줘요! 4 벚꽃과 늑대 2011.02.21 944
RMVX <스크립트> 합성샵과 강화,카드 스크립트 충돌에 대한 오류 file 윌리스 2014.03.14 687
RMVX <특정상태에서 스킬 사용 금지방법> 질문입니다. 3 톰소여동생 2012.06.01 1547
RMXP ABP 액알에서 스킬 문제 Hsik 2010.12.12 721
RMXP ABS 5.5 hud 질문이여 프레 2011.07.17 1853
RMXP ABS 5.5 공격모션에대해서알려주세요 Outsider2 2010.12.14 655
RMXP ABS 5.5 관련 질문 1 글록 2010.11.18 660
RMXP abs 5.5스크립트와 액알모션에대해;; 포미 2010.11.19 711
RMXP ABS 이벤트에아무것도 넣지않을경우 게임제작중 2011.04.15 1036
RMXP ABS 전리품 얻는것오류 질문ㅠㅠ 스샷잇음 ㅠㅠ 1 file 장미송이 2011.01.19 704
RMXP abs5.5 공격 모션... 게이머 2011.03.06 979
RMXP ABS5.5 공격모션 3 글록 2010.11.20 730
RMXP abs5.5 써보신분들 답변좀요 ㅠㅠ 1 file 이노헬 2011.04.26 1144
RMXP ABS5.5 에러 글록 2010.11.21 574
RMXP ABS5.5V미니맵표시 3 file 야구에달인 2011.09.04 2691
RMXP ABS5.5버전 스킬사용에관해서올립니다 답변할사람만클릭 청풍쾌검 2011.01.02 442
RMXP ABS5.5하는분(고수만오셈)이것좀봐주세요 ㅋ 청풍쾌검 2011.01.05 479
RMVX abs8~9 변수조작오류; 초보제작가뉴센 2012.03.17 2326
RMXP ABS_v3액션 알피지 쓰는법좀가르쳐주세요! 4 러쉬 2012.07.26 774
RMXP ABS고수분들은봐주세요 게임제작중 2011.03.24 1318
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 518 Next
/ 518