//创建玩家伤害
var _data = event_data[? "event_type"];
var _msg = event_data[? "message"];
var _element = event_data[? "element_id"];
//检查谁在召唤
if(layer_instance_get_instance(_element) == id)
{
//发送信息的人
if(_data == "sprite event")
{
//检查是否进入攻击状态
if(_msg == "attack")
{
//创建攻击判定框
var _x1, _y1, _x2, _y2;
//清除精灵原点的位置
_x1 = (-sprite_xoffset + sprite_get_bbox_left(sprite_index)) * face;
_y1 = -sprite_yoffset + sprite_get_bbox_top(sprite_index);
_x2 = (- sprite_xoffset + sprite_get_bbox_right(sprite_index)) * face;
_y2 = -sprite_yoffset + sprite_get_bbox_bottom(sprite_index);
my_damage = new Damage(_x1, _y1, _x2, _y2, id);
}
}
}
你在找这个?