设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2766|回复: 1

[原创发布] 事件与事件接触触发事件

[复制链接]

Lv2.观梦者

梦石
0
星屑
382
在线时间
235 小时
注册时间
2009-2-13
帖子
470
发表于 2012-1-20 15:12:26 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
这两天一直忙着研究新系统……但什么也没弄成,不过刚才在制作战争游戏的时候弄了一个事件接触的,刚刚弄好,已经可以启动了,就是不知道不满足条件的时候怎么停止……
脚本:
  1. class Game_Event < Game_Character
  2.   alias hr_check_event_trigger_touch check_event_trigger_touch
  3.   def check_event_trigger_touch(x,y)
  4.     if @event.name[0..4] == "友军"
  5.       for i in $game_map.events.values
  6.         $game_variables[1] = $game_map.events[@event].x
  7.         $game_variables[2] = $game_map.events[@event].y
  8.         
  9.       end
  10.     else
  11.       if @event.name[0..4] == "敌军"
  12.       for i in $game_map.events.values
  13.         $game_variables[3] = $game_map.events[@event].x
  14.         $game_variables[4] = $game_map.events[@event].y
  15.       end
  16.     end
  17.   end
  18.   @hc = ($game_variables[1] - $game_variables[3]).abs
  19.   @zc = ($game_variables[2] - $game_variables[4]).abs
  20.   if (@trigger == 2 and x == $game_player.x and y == $game_player.y) or (@hc = 1 and @zc = 0)
  21.       # 除跳跃中以外的情况、启动判定就是正面的事件
  22.       if not jumping? and not over_trigger?
  23.        start
  24.       
  25.       end
  26.     else
  27.       
  28.     end
  29.     end
  30. #    hr_check_event_trigger_touch(x,y)
  31.   end
  32. #end
复制代码
新建立两个事件,一个名称要有“敌军”,一个要有“友军”,把其中一个设置成“与事件接触”,再添事件就可以了
范例:
http://www.fengzhong123.ys168.com/(RM工程目录下project8)
Project8.rar (881.3 KB, 下载次数: 428)
那些人,那些事,等到明白了,也就无所谓了。
我博客:http://blog.sina.com.cn/gy963

Lv1.梦旅人

梦石
0
星屑
50
在线时间
138 小时
注册时间
2015-6-9
帖子
30
发表于 2016-4-5 21:35:49 | 显示全部楼层
不过,还是谢谢大神  , 辛苦了
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-3-29 19:40

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表