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

Project1

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

[已经解决] 行走图的问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
11 小时
注册时间
2013-6-21
帖子
30
跳转到指定楼层
1
发表于 2014-2-1 10:50:21 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x

第3行是向右走的动画
第4行才是向后走的
改哪个脚本才能把第3行改为向后走的呢·········
第4行改为向右走的

Lv3.寻梦者

梦石
0
星屑
2744
在线时间
2630 小时
注册时间
2013-1-16
帖子
5657

贵宾

2
发表于 2014-2-1 10:52:03 | 只看该作者
改素材啊...
回复 支持 反对

使用道具 举报

Lv5.捕梦者 (版主)

梦石
20
星屑
1840
在线时间
6925 小时
注册时间
2012-12-14
帖子
11485

短篇十战斗者组别冠军开拓者贵宾短篇九勇士组亚军

3
发表于 2014-2-1 10:56:15 | 只看该作者
使用PS切片工具
先分割出来
再新建文件将正确拼合回去

评分

参与人数 2星屑 +120 收起 理由
我爱吴悦淇 + 30 我很赞同
myownroc + 90 我很赞同

查看全部评分

大家好,这里是晨露的说。请多多指教。
刚入门RM软件制作,请大家多多帮助我哦。
落雪君的欢乐像素教程,欢迎查阅。

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
83 小时
注册时间
2013-3-15
帖子
19
4
发表于 2014-2-1 14:00:49 | 只看该作者
。。。。。。。。。。。。非要改脚本吗?

点评

改素材比较好,当然用脚本完全可以实现......  发表于 2014-2-1 14:19
回复 支持 反对

使用道具 举报

Lv3.寻梦者

双子人

梦石
0
星屑
3180
在线时间
3617 小时
注册时间
2009-4-4
帖子
4154

开拓者

5
发表于 2014-2-1 14:32:26 | 只看该作者
用画图来改比较好。

评分

参与人数 1星屑 +90 收起 理由
myownroc + 90 我很赞同

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
11 小时
注册时间
2013-6-21
帖子
30
6
 楼主| 发表于 2014-2-1 15:17:43 | 只看该作者
改素材·有点太多了吧···············想吐血
回复 支持 反对

使用道具 举报

Lv1.梦旅人

幻想天神

梦石
0
星屑
55
在线时间
166 小时
注册时间
2012-3-24
帖子
404
7
发表于 2014-2-1 16:18:17 | 只看该作者
如果非要该脚本的话。。
Game_Character 3里21行改为turn_right
                            67行改为turn_down

或者直接弄上这个脚本覆盖原来的吧。
  1. #==============================================================================
  2. # ■ Game_Character (分割定义 3)
  3. #------------------------------------------------------------------------------
  4. #  处理角色的类。本类作为 Game_Player 类与 Game_Event
  5. # 类的超级类使用。
  6. #==============================================================================

  7. class Game_Character
  8.   #--------------------------------------------------------------------------
  9.   # ● 向下移动
  10.   #     turn_enabled : 本场地位置更改许可标志
  11.   #--------------------------------------------------------------------------
  12.   def move_down(turn_enabled = true)
  13.     # 面向下
  14.     if turn_enabled
  15.       turn_down
  16.     end
  17.     # 可以通行的场合
  18.     if passable?(@x, @y, 2)
  19.       # 面向下
  20.       turn_right
  21.       # 更新坐标
  22.       @y += 1
  23.       # 增加步数
  24.       increase_steps
  25.     # 不能通行的情况下
  26.     else
  27.       # 接触事件的启动判定
  28.       check_event_trigger_touch(@x, @y+1)
  29.     end
  30.   end
  31.   #--------------------------------------------------------------------------
  32.   # ● 向左移动
  33.   #     turn_enabled : 本场地位置更改许可标志
  34.   #--------------------------------------------------------------------------
  35.   def move_left(turn_enabled = true)
  36.     # 面向左
  37.     if turn_enabled
  38.       turn_left
  39.     end
  40.     # 可以通行的情况下
  41.     if passable?(@x, @y, 4)
  42.       # 面向左
  43.       turn_left
  44.       # 更新坐标
  45.       @x -= 1
  46.       # 增加步数
  47.       increase_steps
  48.     # 不能通行的情况下
  49.     else
  50.       # 接触事件的启动判定
  51.       check_event_trigger_touch(@x-1, @y)
  52.     end
  53.   end
  54.   #--------------------------------------------------------------------------
  55.   # ● 向右移动
  56.   #     turn_enabled : 本场地位置更改许可标志
  57.   #--------------------------------------------------------------------------
  58.   def move_right(turn_enabled = true)
  59.     # 面向右
  60.     if turn_enabled
  61.       turn_right
  62.     end
  63.     # 可以通行的场合
  64.     if passable?(@x, @y, 6)
  65.       # 面向右
  66.       turn_down
  67.       # 更新坐标
  68.       @x += 1
  69.       # 增加部数
  70.       increase_steps
  71.     # 不能通行的情况下
  72.     else
  73.       # 接触事件的启动判定
  74.       check_event_trigger_touch(@x+1, @y)
  75.     end
  76.   end
  77.   #--------------------------------------------------------------------------
  78.   # ● 向上移动
  79.   #     turn_enabled : 本场地位置更改许可标志
  80.   #--------------------------------------------------------------------------
  81.   def move_up(turn_enabled = true)
  82.     # 面向上
  83.     if turn_enabled
  84.       turn_up
  85.     end
  86.     # 可以通行的情况下
  87.     if passable?(@x, @y, 8)
  88.       # 面向上
  89.       turn_up
  90.       # 更新坐标
  91.       @y -= 1
  92.       # 歩数増加
  93.       increase_steps
  94.     # 不能通行的情况下
  95.     else
  96.       # 接触事件的启动判定
  97.       check_event_trigger_touch(@x, @y-1)
  98.     end
  99.   end
  100.   #--------------------------------------------------------------------------
  101.   # ● 向左下移动
  102.   #--------------------------------------------------------------------------
  103.   def move_lower_left
  104.     # 没有固定面向的场合
  105.     unless @direction_fix
  106.       # 朝向是右的情况下适合的面是左面、朝向是上的情况下适合的面是下面
  107.       @direction = (@direction == 6 ? 4 : @direction == 8 ? 2 : @direction)
  108.     end
  109.     # 下→左、左→下 的通道可以通行的情况下
  110.     if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 4)) or
  111.        (passable?(@x, @y, 4) and passable?(@x - 1, @y, 2))
  112.       # 更新坐标
  113.       @x -= 1
  114.       @y += 1
  115.       # 增加步数
  116.       increase_steps
  117.     end
  118.   end
  119.   #--------------------------------------------------------------------------
  120.   # ● 向右下移动
  121.   #--------------------------------------------------------------------------
  122.   def move_lower_right
  123.     # 没有固定面向的场合
  124.     unless @direction_fix
  125.       # 朝向是右的情况下适合的面是左面、朝向是上的情况下适合的面是下面
  126.       @direction = (@direction == 4 ? 6 : @direction == 8 ? 2 : @direction)
  127.     end
  128.     # 下→右、右→下 的通道可以通行的情况下
  129.     if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 6)) or
  130.        (passable?(@x, @y, 6) and passable?(@x + 1, @y, 2))
  131.       # 更新坐标
  132.       @x += 1
  133.       @y += 1
  134.       # 增加步数
  135.       increase_steps
  136.     end
  137.   end
  138.   #--------------------------------------------------------------------------
  139.   # ● 向左上移动
  140.   #--------------------------------------------------------------------------
  141.   def move_upper_left
  142.     # 没有固定面向的场合
  143.     unless @direction_fix
  144.       # 朝向是右的情况下适合的面是左面、朝向是上的情况下适合的面是下面
  145.       @direction = (@direction == 6 ? 4 : @direction == 2 ? 8 : @direction)
  146.     end
  147.     # 上→左、左→上 的通道可以通行的情况下
  148.     if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 4)) or
  149.        (passable?(@x, @y, 4) and passable?(@x - 1, @y, 8))
  150.       # 更新坐标
  151.       @x -= 1
  152.       @y -= 1
  153.       # 增加步数
  154.       increase_steps
  155.     end
  156.   end
  157.   #--------------------------------------------------------------------------
  158.   # ● 向右上移动
  159.   #--------------------------------------------------------------------------
  160.   def move_upper_right
  161.     # 没有固定面向的场合
  162.     unless @direction_fix
  163.       # 朝向是右的情况下适合的面是左面、朝向是上的情况下适合的面是下面
  164.       @direction = (@direction == 4 ? 6 : @direction == 2 ? 8 : @direction)
  165.     end
  166.     # 上→右、右→上 的通道可以通行的情况下
  167.     if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 6)) or
  168.        (passable?(@x, @y, 6) and passable?(@x + 1, @y, 8))
  169.       # 更新坐标
  170.       @x += 1
  171.       @y -= 1
  172.       # 增加步数
  173.       increase_steps
  174.     end
  175.   end
  176.   #--------------------------------------------------------------------------
  177.   # ● 随机移动
  178.   #--------------------------------------------------------------------------
  179.   def move_random
  180.     case rand(4)
  181.     when 0  # 向下移动
  182.       move_down(false)
  183.     when 1  # 向左移动
  184.       move_left(false)
  185.     when 2  # 向右移动
  186.       move_right(false)
  187.     when 3  # 向上移动
  188.       move_up(false)
  189.     end
  190.   end
  191.   #--------------------------------------------------------------------------
  192.   # ● 接近主角
  193.   #--------------------------------------------------------------------------
  194.   def move_toward_player
  195.     # 求得与主角的坐标差
  196.     sx = @x - $game_player.x
  197.     sy = @y - $game_player.y
  198.     # 坐标相等情况下
  199.     if sx == 0 and sy == 0
  200.       return
  201.     end
  202.     # 求得差的绝对值
  203.     abs_sx = sx.abs
  204.     abs_sy = sy.abs
  205.     # 横距离与纵距离相等的情况下
  206.     if abs_sx == abs_sy
  207.       # 随机将边数增加 1
  208.       rand(2) == 0 ? abs_sx += 1 : abs_sy += 1
  209.     end
  210.     # 横侧距离长的情况下
  211.     if abs_sx > abs_sy
  212.       # 左右方向优先。向主角移动
  213.       sx > 0 ? move_left : move_right
  214.       if not moving? and sy != 0
  215.         sy > 0 ? move_up : move_down
  216.       end
  217.     # 竖侧距离长的情况下
  218.     else
  219.       # 上下方向优先。向主角移动
  220.       sy > 0 ? move_up : move_down
  221.       if not moving? and sx != 0
  222.         sx > 0 ? move_left : move_right
  223.       end
  224.     end
  225.   end
  226.   #--------------------------------------------------------------------------
  227.   # ● 远离主角
  228.   #--------------------------------------------------------------------------
  229.   def move_away_from_player
  230.     # 求得与主角的坐标差
  231.     sx = @x - $game_player.x
  232.     sy = @y - $game_player.y
  233.     # 坐标相等情况下
  234.     if sx == 0 and sy == 0
  235.       return
  236.     end
  237.     # 求得差的绝对值
  238.     abs_sx = sx.abs
  239.     abs_sy = sy.abs
  240.     # 横距离与纵距离相等的情况下
  241.     if abs_sx == abs_sy
  242.       # 随机将边数增加 1
  243.       rand(2) == 0 ? abs_sx += 1 : abs_sy += 1
  244.     end
  245.     # 横侧距离长的情况下
  246.     if abs_sx > abs_sy
  247.       # 左右方向优先。远离主角移动
  248.       sx > 0 ? move_right : move_left
  249.       if not moving? and sy != 0
  250.         sy > 0 ? move_down : move_up
  251.       end
  252.     # 竖侧距离长的情况下
  253.     else
  254.       # 上下方向优先。远离主角移动
  255.       sy > 0 ? move_down : move_up
  256.       if not moving? and sx != 0
  257.         sx > 0 ? move_right : move_left
  258.       end
  259.     end
  260.   end
  261.   #--------------------------------------------------------------------------
  262.   # ● 前进一步
  263.   #--------------------------------------------------------------------------
  264.   def move_forward
  265.     case @direction
  266.     when 2
  267.       move_down(false)
  268.     when 4
  269.       move_left(false)
  270.     when 6
  271.       move_right(false)
  272.     when 8
  273.       move_up(false)
  274.     end
  275.   end
  276.   #--------------------------------------------------------------------------
  277.   # ● 后退一步
  278.   #--------------------------------------------------------------------------
  279.   def move_backward
  280.     # 记忆朝向固定信息
  281.     last_direction_fix = @direction_fix
  282.     # 强制固定朝向
  283.     @direction_fix = true
  284.     # 朝向分支
  285.     case @direction
  286.     when 2  # 下
  287.       move_up(false)
  288.     when 4  # 左
  289.       move_right(false)
  290.     when 6  # 右
  291.       move_left(false)
  292.     when 8  # 上
  293.       move_down(false)
  294.     end
  295.     # 还原朝向固定信息
  296.     @direction_fix = last_direction_fix
  297.   end
  298.   #--------------------------------------------------------------------------
  299.   # ● 跳跃
  300.   #     x_plus : X 坐标增加值
  301.   #     y_plus : Y 坐标增加值
  302.   #--------------------------------------------------------------------------
  303.   def jump(x_plus, y_plus)
  304.     # 增加值不是 (0,0) 的情况下
  305.     if x_plus != 0 or y_plus != 0
  306.       # 横侧距离长的情况下
  307.       if x_plus.abs > y_plus.abs
  308.         # 变更左右方向
  309.         x_plus < 0 ? turn_left : turn_right
  310.       # 竖侧距离长的情况下
  311.       else
  312.         # 变更上下方向
  313.         y_plus < 0 ? turn_up : turn_down
  314.       end
  315.     end
  316.     # 计算新的坐标
  317.     new_x = @x + x_plus
  318.     new_y = @y + y_plus
  319.     # 增加值为 (0,0) 的情况下、跳跃目标可以通行的场合
  320.     if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y, 0)
  321.       # 矫正姿势
  322.       straighten
  323.       # 更新坐标
  324.       @x = new_x
  325.       @y = new_y
  326.       # 距计算距离
  327.       distance = Math.sqrt(x_plus * x_plus + y_plus * y_plus).round
  328.       # 设置跳跃记数
  329.       @jump_peak = 10 + distance - @move_speed
  330.       @jump_count = @jump_peak * 2
  331.       # 清除停止记数信息
  332.       @stop_count = 0
  333.     end
  334.   end
  335.   #--------------------------------------------------------------------------
  336.   # ● 面向向下
  337.   #--------------------------------------------------------------------------
  338.   def turn_down
  339.     unless @direction_fix
  340.       @direction = 2
  341.       @stop_count = 0
  342.     end
  343.   end
  344.   #--------------------------------------------------------------------------
  345.   # ● 面向向左
  346.   #--------------------------------------------------------------------------
  347.   def turn_left
  348.     unless @direction_fix
  349.       @direction = 4
  350.       @stop_count = 0
  351.     end
  352.   end
  353.   #--------------------------------------------------------------------------
  354.   # ● 面向向右
  355.   #--------------------------------------------------------------------------
  356.   def turn_right
  357.     unless @direction_fix
  358.       @direction = 6
  359.       @stop_count = 0
  360.     end
  361.   end
  362.   #--------------------------------------------------------------------------
  363.   # ● 面向向上
  364.   #--------------------------------------------------------------------------
  365.   def turn_up
  366.     unless @direction_fix
  367.       @direction = 8
  368.       @stop_count = 0
  369.     end
  370.   end
  371.   #--------------------------------------------------------------------------
  372.   # ● 向右旋转 90 度
  373.   #--------------------------------------------------------------------------
  374.   def turn_right_90
  375.     case @direction
  376.     when 2
  377.       turn_left
  378.     when 4
  379.       turn_up
  380.     when 6
  381.       turn_down
  382.     when 8
  383.       turn_right
  384.     end
  385.   end
  386.   #--------------------------------------------------------------------------
  387.   # ● 向左旋转 90 度
  388.   #--------------------------------------------------------------------------
  389.   def turn_left_90
  390.     case @direction
  391.     when 2
  392.       turn_right
  393.     when 4
  394.       turn_down
  395.     when 6
  396.       turn_up
  397.     when 8
  398.       turn_left
  399.     end
  400.   end
  401.   #--------------------------------------------------------------------------
  402.   # ● 旋转 180 度
  403.   #--------------------------------------------------------------------------
  404.   def turn_180
  405.     case @direction
  406.     when 2
  407.       turn_up
  408.     when 4
  409.       turn_right
  410.     when 6
  411.       turn_left
  412.     when 8
  413.       turn_down
  414.     end
  415.   end
  416.   #--------------------------------------------------------------------------
  417.   # ● 从右向左旋转 90 度
  418.   #--------------------------------------------------------------------------
  419.   def turn_right_or_left_90
  420.     if rand(2) == 0
  421.       turn_right_90
  422.     else
  423.       turn_left_90
  424.     end
  425.   end
  426.   #--------------------------------------------------------------------------
  427.   # ● 随机变换方向
  428.   #--------------------------------------------------------------------------
  429.   def turn_random
  430.     case rand(4)
  431.     when 0
  432.       turn_up
  433.     when 1
  434.       turn_right
  435.     when 2
  436.       turn_left
  437.     when 3
  438.       turn_down
  439.     end
  440.   end
  441.   #--------------------------------------------------------------------------
  442.   # ● 接近主角的方向
  443.   #--------------------------------------------------------------------------
  444.   def turn_toward_player
  445.     # 求得与主角的坐标差
  446.     sx = @x - $game_player.x
  447.     sy = @y - $game_player.y
  448.     # 坐标相等的场合下
  449.     if sx == 0 and sy == 0
  450.       return
  451.     end
  452.     # 横侧距离长的情况下
  453.     if sx.abs > sy.abs
  454.       # 将左右方向变更为朝向主角的方向
  455.       sx > 0 ? turn_left : turn_right
  456.     # 竖侧距离长的情况下
  457.     else
  458.       # 将上下方向变更为朝向主角的方向
  459.       sy > 0 ? turn_up : turn_down
  460.     end
  461.   end
  462.   #--------------------------------------------------------------------------
  463.   # ● 背向主角的方向
  464.   #--------------------------------------------------------------------------
  465.   def turn_away_from_player
  466.     # 求得与主角的坐标差
  467.     sx = @x - $game_player.x
  468.     sy = @y - $game_player.y
  469.     # 坐标相等的场合下
  470.     if sx == 0 and sy == 0
  471.       return
  472.     end
  473.     # 横侧距离长的情况下
  474.     if sx.abs > sy.abs
  475.       # 将左右方向变更为背离主角的方向
  476.       sx > 0 ? turn_right : turn_left
  477.     # 竖侧距离长的情况下
  478.     else
  479.       # 将上下方向变更为背离主角的方向
  480.       sy > 0 ? turn_down : turn_up
  481.     end
  482.   end
  483. end
复制代码

点评

如果考虑通行问题。62行改为turn_down 16行改为turn_right  发表于 2014-2-1 16:19

评分

参与人数 2星屑 +135 收起 理由
我爱吴悦淇 + 15 我很赞同
myownroc + 120 塞糖

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
49
在线时间
49 小时
注册时间
2013-7-28
帖子
43
8
发表于 2014-2-1 19:41:07 | 只看该作者
同学,你弱爆了,用画图软件就可以搞定的,最后加底色就可以了
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
49
在线时间
49 小时
注册时间
2013-7-28
帖子
43
9
发表于 2014-2-1 19:42:45 | 只看该作者
7楼的方法也可以,不过大多素材都是正常的,你的素材不正常,下载了正常的还要为了这个不正常的改正常的成不正常的,你会发现很麻烦,懂了吗?

评分

参与人数 1星屑 +120 收起 理由
myownroc + 120 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
11 小时
注册时间
2013-6-21
帖子
30
10
 楼主| 发表于 2014-2-2 08:22:14 | 只看该作者
谢谢大家啦············楼上你说的很对嘛··········
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-30 17:40

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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