设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2024|回复: 3
打印 上一主题 下一主题

待机动画与八方行走脚本冲突

 关闭 [复制链接]
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-12-29
帖子
23
跳转到指定楼层
1
发表于 2007-12-30 06:09:13 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-12-29
帖子
23
2
 楼主| 发表于 2007-12-30 06:09:13 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽

Lv1.梦旅人

Ruby Z

梦石
0
星屑
50
在线时间
1 小时
注册时间
2007-6-24
帖子
166
3
发表于 2007-12-30 06:24:53 | 只看该作者
是伪·八方向还是真·八方向啊
终于做完了,累死我了……
回复 支持 反对

使用道具 举报

Lv1.梦旅人

Ruby Z

梦石
0
星屑
50
在线时间
1 小时
注册时间
2007-6-24
帖子
166
4
发表于 2007-12-30 06:35:48 | 只看该作者
待机动画+伪·八方向
  1. #==============================================================================
  2. # ■ Game_Character (分割定义 1)
  3. #------------------------------------------------------------------------------
  4. #  处理角色的类。本类作为 Game_Player 类与 Game_Event
  5. # 类的超级类使用。
  6. #==============================================================================

  7. class Game_Character
  8.   attr_accessor :time
  9.   #--------------------------------------------------------------------------
  10.   # ● 初始化对像
  11.   #--------------------------------------------------------------------------
  12.   alias old_ini initialize
  13.   def initialize
  14.     old_ini
  15.     @time = 0
  16.   end
  17. end

  18. #==============================================================================
  19. # ■ Game_Player
  20. #------------------------------------------------------------------------------
  21. #  处理主角的类。事件启动的判定、以及地图的滚动等功能。
  22. # 本类的实例请参考 $game_player。
  23. #==============================================================================

  24. class Game_Player < Game_Character
  25.   TIME_LIMIT = 13  # 抓耳挠腮前的等待时间 (好象也不是帧…不知道是什么单位了)
  26.   #--------------------------------------------------------------------------
  27.   # ● 画面更新
  28.   #--------------------------------------------------------------------------
  29.   def update
  30.     # 本地变量记录移动信息
  31.     last_moving = moving?
  32.     if @time == TIME_LIMIT
  33.       @character_name = @character_name + "_W"
  34.       @scratch = true
  35.       @step_anime = true
  36.       @time = TIME_LIMIT + 1
  37.     elsif @time < TIME_LIMIT
  38.       @scratch = false
  39.       @step_anime = false
  40.     end
  41.     if @scratch == false
  42.       @old_pic = @character_name
  43.     end
  44.     # 移动中、事件执行中、强制移动路线中、
  45.     # 信息窗口一个也不显示的时候
  46.     unless moving? or $game_system.map_interpreter.running? or
  47.            @move_route_forcing or $game_temp.message_window_showing
  48.       # 如果方向键被按下、主角就朝那个方向移动
  49.      case Input.dir8
  50.      when 1
  51.        move_lower_left
  52.      when 2
  53.        move_down
  54.      when 3
  55.        move_lower_right
  56.      when 4
  57.        move_left
  58.      when 6
  59.        move_right
  60.      when 7
  61.        move_upper_left
  62.      when 8
  63.        move_up
  64.      when 9
  65.        move_upper_right
  66.      end
  67.     end
  68.     # 本地变量记忆坐标
  69.     last_real_x = @real_x
  70.     last_real_y = @real_y
  71.     super
  72.     # 角色向下移动、画面上的位置在中央下方的情况下
  73.     if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
  74.       # 画面向下卷动
  75.       $game_map.scroll_down(@real_y - last_real_y)
  76.     end
  77.     # 角色向左移动、画面上的位置在中央左方的情况下
  78.     if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
  79.       # 画面向左卷动
  80.       $game_map.scroll_left(last_real_x - @real_x)
  81.     end
  82.     # 角色向右移动、画面上的位置在中央右方的情况下
  83.     if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
  84.       # 画面向右卷动
  85.       $game_map.scroll_right(@real_x - last_real_x)
  86.     end
  87.     # 角色向上移动、画面上的位置在中央上方的情况下
  88.     if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
  89.       # 画面向上卷动
  90.       $game_map.scroll_up(last_real_y - @real_y)
  91.     end
  92.     # 不在移动中的情况下
  93.     unless moving?
  94.       @time += 1 if @time < TIME_LIMIT
  95.       # 上次主角移动中的情况
  96.       if last_moving
  97.         # 与同位置的事件接触就判定为事件启动
  98.         result = check_event_trigger_here([1,2])
  99.         # 没有可以启动的事件的情况下
  100.         if result == false
  101.           # 调试模式为 ON 并且按下 CTRL 键的情况下除外
  102.           unless $DEBUG and Input.press?(Input::CTRL)
  103.             # 遇敌计数下降
  104.             if @encounter_count > 0
  105.               @encounter_count -= 1
  106.             end
  107.           end
  108.         end
  109.       end
  110.       # 按下 C 键的情况下
  111.       if Input.trigger?(Input::C)
  112.         # 判定为同位置以及正面的事件启动
  113.         check_event_trigger_here([0])
  114.         check_event_trigger_there([0,1,2])
  115.       end
  116.     end
  117.   end
  118. end
复制代码
终于做完了,累死我了……
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2026-6-19 23:22

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表