以下引用stella于2009-5-17 13:39:28的发言:
请问楼上,怎么在事件的脚本里判断啊? if 1号事件移动到边界,就打开10号开关
以下引用Flyingpww于2009-5-17 13:30:18的发言:
def is_in_verge?(x,y)
x1 = 0...$game_map.width
y1 = 0...$game_map.height
if x1.include?(x) and (y == 0 or y == $game_map.height-1)
return true
elsif y1.include?(y) and (x == 0 or x == $game_map.width-1)
return true
end
return false
end
class Interpreter
def is_in_verge?(x, y)
...
end
end
class Game_Map
alias update_old update if !method_defined? :update_old
def update
update_old
if @events[3] && @events[3].x == 0 ||
@events[3].x == $game_map.width - 1 ||
@events[3].y == 0 ||
@events[3].y == $game_map.height - 1
@events[3].moveto($game_player.x, $game_player.y)
end
end
end
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |