| 赞 | 6  | 
 
| VIP | 22 | 
 
| 好人卡 | 15 | 
 
| 积分 | 13 | 
 
| 经验 | 97563 | 
 
| 最后登录 | 2022-11-26 | 
 
| 在线时间 | 831 小时 | 
 
 
 
 
 
Lv3.寻梦者 
	- 梦石
 - 0 
 
        - 星屑
 - 1344 
 
        - 在线时间
 - 831 小时
 
        - 注册时间
 - 2007-12-25
 
        - 帖子
 - 1558
 
 
 
 | 
	
为你写了个定做 
不认可对不起我 
 
- #==================================================================
 
 - #使跳跃支持变量操作
 
 - #
 
 - #使用方法,约定如下
 
 - # 当x坐标设定为99时,跳跃步数为 变量甲
 
 - # 当y坐标设定为99时,跳跃步数为 变量乙
 
 - #  变量甲 乙,在脚本中设定,在跳跃之前
 
 - # 先处理这两个变量,然后跳跃步数填为99级可
 
 - #====================================================================
 
 - class Game_Character
 
 -   #--------------------------------------------------------------------------
 
 -   # ● 跳跃
 
 -   #     x_plus : X 坐标增加值
 
 -   #     y_plus : Y 坐标增加值
 
 -   #--------------------------------------------------------------------------
 
 -   def jump(x_plus, y_plus)
 
 -     # 增加值不是 (0,0) 的情况下
 
 -     @swtf_x = 1                            #当填写99时,x使用变量ID
 
 -     @swtf_y = 2                            #当填写99时,y使用变量ID
 
 -    x_plus = $game_variables[@swtf_x] if x_plus = 99 
 
 -    y_plus = $game_variables[@swtf_y] if x_plus = 99
 
 -     if x_plus != 0 or y_plus != 0
 
 -       # 横侧距离长的情况下
 
 -       if x_plus.abs > y_plus.abs
 
 -         # 变更左右方向
 
 -         x_plus < 0 ? turn_left : turn_right
 
 -       # 竖侧距离长的情况下
 
 -       else
 
 -         # 变更上下方向
 
 -         y_plus < 0 ? turn_up : turn_down
 
 -       end
 
 -     end
 
 -     # 计算新的坐标
 
 -     new_x = @x + x_plus
 
 -     new_y = @y + y_plus
 
 -     # 增加值为 (0,0) 的情况下、跳跃目标可以通行的场合
 
 -     if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y, 0)
 
 -       # 矫正姿势
 
 -       straighten
 
 -       # 更新坐标
 
 -       @x = new_x
 
 -       @y = new_y
 
 -       # 距计算距离
 
 -       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
 
 -     end
 
 -   end
 
 - end  
 
  复制代码 
 
不会用联系我  系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~ |   
 
 
 
 |