事件与事件接触触发事件
这两天一直忙着研究新系统……但什么也没弄成,不过刚才在制作战争游戏的时候弄了一个事件接触的,刚刚弄好,已经可以启动了,就是不知道不满足条件的时候怎么停止……脚本:class Game_Event < Game_Characteralias hr_check_event_trigger_touch check_event_trigger_touchdef check_event_trigger_touch(x,y) if @event.name == "友军" for i in $game_map.events.values $game_variables = $game_map.events[@event].x $game_variables = $game_map.events[@event].y end else if @event.name == "敌军" for i in $game_map.events.values $game_variables = $game_map.events[@event].x $game_variables = $game_map.events[@event].y end endend@hc = ($game_variables - $game_variables).abs@zc = ($game_variables - $game_variables).absif (@trigger == 2 and x == $game_player.x and y == $game_player.y) or (@hc = 1 and @zc = 0) # 除跳跃中以外的情况、启动判定就是正面的事件 if not jumping? and not over_trigger? start end else end end# hr_check_event_trigger_touch(x,y)end#end复制代码新建立两个事件,一个名称要有“敌军”,一个要有“友军”,把其中一个设置成“与事件接触”,再添事件就可以了
范例:
http://www.fengzhong123.ys168.com/(RM工程目录下project8)
【注意】这个版本还不完善,就比如两个事件分开后貌似还会执行,因此各位谁有兴趣可以试着修复一下。
本帖来自P1论坛作者风中承诺,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址:https://rpg.blue/forum.php?mod=viewthread&tid=220072若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。
页:
[1]