赞 | 0 |
VIP | 1 |
好人卡 | 0 |
积分 | 1 |
经验 | 1064 |
最后登录 | 2012-12-8 |
在线时间 | 4 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 4 小时
- 注册时间
- 2008-6-5
- 帖子
- 312
|
#--------------------------------------------------------------------------
# ● 向右下移动
#--------------------------------------------------------------------------
def move_lower_right
# 没有固定面向的场合
unless @direction_fix
# 朝向是右的情况下适合的面是左面、朝向是上的情况下适合的面是下面
@direction = (@direction == 4 ? 6 : @direction == 8 ? 2 : @direction)
end
# 下→右、右→下 的通道可以通行的情况下
if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 6)) or
(passable?(@x, @y, 6) and passable?(@x + 1, @y, 2))
# 更新坐标
@x += 1
@y += 1
# 增加步数
increase_steps
elsif passable?(@x, @y, Input::DOWN) and can_go?(@x + 1, @y + 1)
unless @direction_fix
@direction = 2
end
@y += 1
increase_steps
elsif passable?(@x, @y, Input::RIGHT) and can_go?(@x + 1, @y + 1)
unless @direction_fix
@direction = 6
end
@x += 1
increase_steps
end
end
看看这个,direction设置的还是2和6,
行走图的切图当然不会对了
sx = @character.pattern * @cw
if $c3_总共可用的方向数==8
case @character.direction
when 2
sy = 0 * @ch
when 4
sy = 1 * @ch
when 6
sy = 2 * @ch
when 8
sy = 3 * @ch
when 1
sy = 4 * @ch
when 3
sy = 5 * @ch
when 7
sy = 6 * @ch
when 9
sy = 7 * @ch
end
else
sy = (@character.direction - 2) / 2 * @ch
end
self.src_rect.set(sx, sy, @cw, @ch)
在这个下面加个方向
# 下→右、右→下 的通道可以通行的情况下
if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 6)) or
(passable?(@x, @y, 6) and passable?(@x + 1, @y, 2))
# 更新坐标
@x += 1
@y += 1
@direction = 7 ############################# 这里 {/se}
|
|