private void UpdateCollisionBullet(CAnimationObject _Object) { if (m_Bullet1 != null) { m_Bullet1.UpdateCollision(_Object); _Object.UpdateCollision(m_Bullet1); if (m_Bullet1.Status == IDStatus.DIE) { m_Bullet1 = null; } } if (m_Bullet2 != null) { m_Bullet2.UpdateCollision(_Object); _Object.UpdateCollision(m_Bullet2); if (m_Bullet2.Status == IDStatus.DIE) { m_Bullet2 = null; } } }
private void AddBullet() { if (m_Bullet1 == null) { m_Bullet1 = new Bullet(this.Position, this.Direction); SoundManager.PlaySound(ESound.SFX_FIREBALL); return; } if (m_Bullet2 == null) { m_Bullet2 = new Bullet(this.Position, this.Direction); SoundManager.PlaySound(ESound.SFX_FIREBALL); return; } }
private void ManageBullet() { if (m_Bullet1 != null) { //if (Math.Abs(m_Bullet1.Position.X - Position.X) > GlobalValue.SCREEN_WIDTH || m_Bullet1.Status == IDStatus.DIE) //{ // m_Bullet1 = null; //} if (!GlobalValue.CAMERA_RECTANGLE.Intersects(m_Bullet1.GetBound())) { m_Bullet1 = null; } } if (m_Bullet2 != null) { if (!GlobalValue.CAMERA_RECTANGLE.Intersects(m_Bullet2.GetBound())) { m_Bullet2 = null; } } //if (m_Bullet2 != null) //{ // if (Math.Abs(m_Bullet2.Position.X - Position.X) > GlobalValue.SCREEN_WIDTH || m_Bullet2.Status == IDStatus.DIE) // { // m_Bullet2 = null; // } //} }