void bomb_Removed(object sender, RemovedEventArgs e) { Vector2D position = new Vector2D(rand.Next(0, 1400), 0); Scalar velocityMag = rand.Next(1000, 2000); Vector2D velocity = Vector2D.SetMagnitude(bombTarget - position, velocityMag); bomb.Lifetime = new Lifespan(); bomb.State.Position.Linear = position; bomb.State.Velocity.Linear = velocity; bomb.State.Position.Angular = velocity.Angle; bomb.State.Velocity.Angular = 0; engine.AddBody(bomb); AddGlObject(bomb); }
void entity_Removed(object sender, RemovedEventArgs e) { this.entity.PositionChanged -= entity_NewState; this.entity.Removed -= entity_Removed; this.removed = true; }