赞 | 1 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 5065 |
最后登录 | 2016-3-23 |
在线时间 | 99 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 99 小时
- 注册时间
- 2011-3-19
- 帖子
- 41
|
我原来改过一个。但是后来发现有个严重的问题。因为斜着走的缘故,地图上有一半格子走不到(国际象棋里的象)。而且和事件触发的手感也很差。后来就改回默认的了。
xfyx于2011-5-1 10:57补充以下内容:
#--------------------------------------------------------------------------
# ● 下(左下)
# turn_ok : 此地可以更改朝向
#--------------------------------------------------------------------------
def move_down(turn_ok = true)
unless @direction_fix
@direction = (@direction == 6 ? 4 : @direction == 8 ? 2 : @direction)
end
if (passable?(@x, @y+1) and passable?(@x-1, @y+1)) or
(passable?(@x-1, @y) and passable?(@x-1, @y+1))
turn_down
@x -= 1
@y += 1
increase_steps
@move_failed = false
else # 不可以通过
turn_down if turn_ok
check_event_trigger_touch(@x, @y+1) # 判断接触的事件启动
@move_failed = true
end
end
#--------------------------------------------------------------------------
# ● 左(左上)
# turn_ok : 此地可以更改朝向
#--------------------------------------------------------------------------
def move_left(turn_ok = true)
unless @direction_fix
@direction = (@direction == 6 ? 4 : @direction == 2 ? 8 : @direction)
end
if (passable?(@x, @y-1) and passable?(@x-1, @y-1)) or
(passable?(@x-1, @y) and passable?(@x-1, @y-1))
turn_left
@x -= 1
@y -= 1
increase_steps
@move_failed = false
else # 不可以通过
turn_left if turn_ok
check_event_trigger_touch(@x-1, @y) # 判断接触的事件启动
@move_failed = true
end
end
#--------------------------------------------------------------------------
# ● 右(右下)
# turn_ok : 此地可以更改朝向
#--------------------------------------------------------------------------
def move_right(turn_ok = true)
unless @direction_fix
@direction = (@direction == 4 ? 6 : @direction == 8 ? 2 : @direction)
end
if (passable?(@x, @y+1) and passable?(@x+1, @y+1)) or
(passable?(@x+1, @y) and passable?(@x+1, @y+1))
turn_right
@x += 1
@y += 1
increase_steps
@move_failed = false
else # 不可以通过
turn_right if turn_ok
check_event_trigger_touch(@x+1, @y) # 判断接触的事件启动
@move_failed = true
end
end
#--------------------------------------------------------------------------
# ● 上(右上)
# turn_ok : 此地可以更改朝向
#--------------------------------------------------------------------------
def move_up(turn_ok = true)
unless @direction_fix
@direction = (@direction == 4 ? 6 : @direction == 2 ? 8 : @direction)
end
if (passable?(@x, @y-1) and passable?(@x+1, @y-1)) or
(passable?(@x+1, @y) and passable?(@x+1, @y-1))
turn_up
@x += 1
@y -= 1
increase_steps
@move_failed = false
else # 不可以通过
turn_up if turn_ok
check_event_trigger_touch(@x, @y-1) # 判断接触的事件启动
@move_failed = true
end
end
这应该算“伪”吧 |
|