RPGXP スクリプト
2013.09.24 08:23

커다란 그래픽 좁은 길 못지나가는 스크립트

閲覧数 1118 推奨数 0 コメント 0
?

Shortcut

Prev前へ 書き込み

Next次へ 書き込み

Larger Font Smaller Font 上へ 下へ Go comment 印刷
?

Shortcut

Prev前へ 書き込み

Next次へ 書き込み

Larger Font Smaller Font 上へ 下へ Go comment 印刷
#┌───────────────────────────────────────
#│
#│  TRCS.17
#│  "Game_Character 修正" ver1.00β (2005.11.05 h12)
#│  by NO
#│  http://chobi.net/~no/
#│  
#└───────────────────────────────────────

#┌───────────────────────────────────────
#│β版仕?
#│  ?マップチップ、キャラクタ?との?たり判定を修正します。
#│  ?イベントとの?たり判定部分が未解決です。
#└───────────────────────────────────────


#==============================================================================
# ■ Game_Character
#==============================================================================

class Game_Character
  #--------------------------------------------------------------------------
  # ○ オブジェクト初期化
  #--------------------------------------------------------------------------
  def trcs17_initialize initialize
    # キャラクタ?サイズの判定フラグ初期化
    @big = false
    # キャラクタ?グラフィックが表示されているセルの座標
    @x_list = []
    @y_list = []
    # 呼び?す
    trcs17_initialize
  end
  #--------------------------------------------------------------------------
  # ○ キャラクタ?サイズが基準以上か?
  #--------------------------------------------------------------------------
  def big?
    return @big
  end
  #--------------------------------------------------------------------------
  # ○ キャラクタ?グラフィックが表示されているセルの座標
  #--------------------------------------------------------------------------
  def cell_list
    return @x_list, @y_list
  end
  #--------------------------------------------------------------------------
  # ○ 通行可能判定
  #     x : X 座標
  #     y : Y 座標
  #     d : 方向 (0,2,4,6,8)  ※ 0 = 全方向通行不可の場合を判定 (ジャンプ用)
  #--------------------------------------------------------------------------
  alias trcs17_passable? passable?
  def passable?(x, y, d)
    # キャラクタ?ファイル名が定義されている場合
    unless @character_name == ""
      # キャラクタ?グラフィックオブジェクトを定義
      character = RPG::Cache.character(@character_name, @character_hue)
      # 倍率計算
      div_x = character.width / (32 * 4)
      div_y = character.height / (48 * 4)
      div_x = 1 if div_x < 1
      div_y = 1 if div_y < 1
      # x, yともに1倍の場合
      if div_x == 1 and div_y == 1
        # 呼び?す
        return trcs17_passable?(x, y, d)
      else
        # [基準サイズ以上である]をセット
        @big = true
        # [キャラクタ?グラフィックが表示されているセルの座標]の配列
        @x_list = [0]
        @y_list = [0]
        # 現位置において、
        # キャラクタ?グラフィックが表示されている全セルのx座標の算出
        # → グラフィックの幅は左右に等しい (基準の3倍ならば □■□)
        for i in 1..div_x / 2
          @x_list.unshift(-i)  if i == 1 and d != 6 # 本?の座標が移動の邪魔になるため
          @x_list.push(i)      if i == 1 and d != 4 # 本?の座標が移動の邪魔になるため
        end
        # 現位置において、
        # キャラクタ?グラフィックが表示されている全セルのy座標の算出
        # → y座標は?方向(負)に[基準のn倍]
        for i in 1...div_y
          @y_list.unshift(-i) if i == 1 and d != 2 # 本?の座標が移動の邪魔になるため
        end
        # 評?値の初期化
        bool = true
        # 二重ル?プで各座標を渡す
        for i in 0...@x_list.size
          for j in 0...@y_list.size
            x2 = @x_list[i]
            y2 = @y_list[j]
            # 呼び?す & ??値の評?
            # → 一度でもfalseになったら通行不可
            bool &= trcs17_passable?(x + x2, y + y2, d)
          end
        end
        # 評?値を返す
        return bool
      end
    else
      # 呼び?す
      return trcs17_passable?(x, y, d)
    end
  end
end

출처: 게임공작소
?

  1. 한글조합입력기(영어가능)

    Date2019.11.10 CategoryRPGXP スクリプト By조규진1 Views1283 Votes0
    Read More
  2. RPG XP Xas액알

    Date2018.10.30 CategoryRPGXP スクリプト By심심치 Views1530 Votes0
    Read More
  3. Font Setup

    Date2016.07.22 CategoryRPGXP スクリプト By운님 Views1849 Votes0
    Read More
  4. 대화에 얼굴이 나오는 스크립트 by: killarot(네이버 dust_mite)(수정버전)

    Date2016.02.22 CategoryRPGXP スクリプト By부초 Views2265 Votes0
    Read More
  5. RPGXP ATB전투 시스템 예제(스크립트는 예제 안에 포함)

    Date2015.11.17 CategoryRPGXP スクリプト ByMagNesium Views1071 Votes0
    Read More
  6. 스테이터스,보수,골드,플레임 타임 삭제

    Date2015.06.02 CategoryRPGXP スクリプト Byrpgmakingbot Views1033 Votes0
    Read More
  7. 헤드 업 디스플레이 스크립트

    Date2015.01.30 CategoryRPGXP スクリプト By 운 Views1140 Votes0
    Read More
  8. 컬러 비트맵 타이틀 스크립트

    Date2015.01.20 CategoryRPGXP スクリプト By 운 Views1090 Votes1
    Read More
  9. 로고 스크립트

    Date2014.12.10 CategoryRPGXP スクリプト By 운 Views1442 Votes1
    Read More
  10. 타이틀 로딩 스크립트

    Date2014.12.07 CategoryRPGXP スクリプト By 운 Views1331 Votes0
    Read More
  11. 타이틀 스크립트

    Date2014.12.05 CategoryRPGXP スクリプト By 운 Views1308 Votes0
    Read More
  12. 액알 스크립트

    Date2014.11.23 CategoryRPGXP スクリプト By커비♥ Views1696 Votes1
    Read More
  13. 공포게임에 장비착용메뉴

    Date2014.08.24 CategoryRPGXP スクリプト By 운 Views1707 Votes0
    Read More
  14. 얼굴표시/문장을 한글자씩 나타내주는 스크립트 (출처-히페리온)

    Date2014.06.22 CategoryRPGXP スクリプト By시르카 Views1466 Votes0
    Read More
  15. 횡스크롤 점프 [버튼허용스위치추가]

    Date2014.06.01 CategoryRPGXP スクリプト By 운 Views1909 Votes0
    Read More
  16. 말풍선 메세지 스크립트

    Date2014.02.24 CategoryRPGXP スクリプト By천둥번들 Views2072 Votes0
    Read More
  17. 스텟찍기스크립트

    Date2014.02.22 CategoryRPGXP スクリプト By천둥번들 Views2132 Votes3
    Read More
  18. 달리기스크립트

    Date2014.02.22 CategoryRPGXP スクリプト By천둥번들 Views2557 Votes2
    Read More
  19. 8방향 이동스크립트

    Date2014.02.22 CategoryRPGXP スクリプト By천둥번들 Views2029 Votes6
    Read More
  20. AraLab_MultiStartingPoint (다중 출발점 스크립트, 캐릭터 선택 스크립트) ver.0.2beta

    Date2014.01.21 CategoryRPGXP スクリプト By 운 Views2301 Votes1
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 Next
/ 8