질문과 답변

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 12387
RMVXA vx ace 새로나온 엑터 moopu 2012.01.04 3111
vx ace에서 한글 폰트가 깨져서 나와요 ㅠㅠ 8 file 아이펀사 2014.06.22 3108
기타 배포용게임만들고 시험다운중 .. 4 아이큐TV 2012.01.16 3100
RMVXA ACE써본분들께 질문 3 환상소설 2011.12.31 3099
RMVX 침대나 그런 맵칩을 깔면 이렇게 되요ㅠㅠ 2 file 오니제작초딩 2012.01.01 3094
기타 개설 축하 겸 질문 하나만영.... 10 샺쿠 2011.08.01 3088
RMVX Tile A를 다운받아서 쓰면 벽을 통과해요 2 아브렐라 2012.01.28 3087
기타 우수게임 평가단 or 게임 평가 자격을 얻고 싶습니다. 카로 2012.05.08 3079
RMXP xp 엑터만들기 unuseid 2012.01.03 3077
RMVX 스킬만들때 분산도가 뭔가요? 4 마차군 2012.01.01 3077
RMVX RPG VX 사이드뷰시 적 이미지가 보행칩 자체로 나와요 ㅜㅜ 6 file 아방가르등 2012.02.19 3068
RMXP rpg xp 게임 실행 6 file SerenJU 2013.02.22 3048
RMVX 주인공 모습 바꾸는 방법 좀 알려주세요.~ 1 레몬은시다 2011.12.31 3047
기타 울프 RPG 에디터라는 건 뭔가요? 엿데브 2011.06.29 3045
RMVXA rpg vx ace에서 사이드뷰가 가능한지 1 avvxace 2012.02.04 3044
RMVX Srpg의 턴 종료 시키기(재 작성) 1 file minibalrog 2012.04.03 3033
RMVXA 아오오니처럼 이름박스가 따로 뜨게 하는방법... 3 file Shalon 2012.05.20 3031
RMXP 윈도우7의 알만툴XP 페이드아웃 오류 1 겨울별 2011.10.10 3020
RMXP 화면 확대하는 법? 1 오디넬 2012.03.22 3019
기타 몬스터 배치 1 초보자입돠 2011.12.31 3019
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 516 Next
/ 516