赞 | 0 |
VIP | 37 |
好人卡 | 0 |
积分 | 1 |
经验 | 48662 |
最后登录 | 2012-11-14 |
在线时间 | 3 小时 |
Lv1.梦旅人 SB們大家好<
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 3 小时
- 注册时间
- 2008-1-7
- 帖子
- 457
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
- class Game_Map
- #--------------------------------------------------------------------------
- def in_range?(object)
- screne_x = $game_map.display_x
- screne_x -= 256
- screne_y = $game_map.display_y
- screne_y -= 256
- screne_width = $game_map.display_x
- screne_width += 5632
- screne_height = $game_map.display_y
- screne_height += 4352
- return false if object.real_x <= screne_x
- return false if object.real_x >= screne_width
- return false if object.real_y <= screne_y
- return false if object.real_y >= screne_height
- return true
- end
- #--------------------------------------------------------------------------
- # ● 刷新事件
- #--------------------------------------------------------------------------
- def update_events
- for event in @events.values
- next if !in_range?(event) and event.trigger != 3 and event.trigger != 4
- event.update
- end
- for common_event in @common_events.values
- common_event.update
- end
- end
- end
复制代码
今天做游戏的时候建了一张大地图,地图切换的事件有50个左右,发现FPS降到50,于是就把XP的这个脚本改了下,效果还行,如果你和我一样屏幕外非自动执行,并行处理的事件不需要刷新的话,就使用吧。
2.27 忘记 VX的 real_x = x * 256 而不是XP的128了,修正 |
|