//添加英雄身体 public void PushBody(int x, int y) { _BODY tmp = new _BODY(); tmp.x = x; tmp.y = y; m_BodyList.LoadObj(m_BodyLen, tmp); m_BodyLen++; }
//添加英雄身体 public void PushBody() { _BODY tmp = new _BODY(); tmp.x = (m_x - m_w / 2) + m_w; tmp.y = m_y; tmp.body = new CCustomImage(Properties.Resources.body, m_w, m_h); tmp.body.SetPos(tmp.x, tmp.y); m_BodyList.LoadObj(m_BodyLen, tmp); m_BodyLen++; }
//修改身体y public void SetBodyY(int id, int y) { //安全检测 if (id > m_BodyLen) { return; } _BODY tmp = new _BODY(); tmp.y = y; tmp.x = GetBodyX(id); m_BodyList.SetObj(id, tmp); }
//修改身体y private void SetBodyY(int id, double y) { //安全检测 if (id > m_BodyLen) { return; } _BODY tmp = new _BODY(); tmp.y = y; tmp.x = m_BodyList.GetObject(id).x; tmp.body = m_BodyList.GetObject(id).body; m_BodyList.SetObj(id, tmp); }