| 赞 | 2 |
| VIP | |
| 好人卡 | |
| 积分 | 18 |
| 经验 | |
| 最后登录 | 2026-5-24 |
| 在线时间 | 1313 小时 |
- 梦石
- 0
- 星屑
- 1788
- 在线时间
- 1313 小时
- 注册时间
- 2012-8-4
- 回帖
- 724
|
发表于 2018-4-16 14:39:54
|
显示全部楼层
调用方法$game_map.batch_check_event(17,13,1,1)
检查地图坐标
17,13
17,14
18,13
18,14
是否有事件存在,返回Bollean结果
[pre lang="ruby"]class Game_Map
def batch_check_event(start_x, start_y, width, height)
end_x = start_x + width
end_y = start_y + height
if start_x > end_x
start_x = start_x^end_x
end_x = end_x^start_x
start_x = start_x^end_x
end
if start_y > end_y
start_y = start_y^end_y
end_y = end_y^start_y
start_y = start_y^end_y
end
for x in start_x .. end_x
for y in start_y .. end_y
return true if $game_map.check_event(x, y).is_a? Integer
end
end
return false
end
end[/pre] |
|