public void BreakIceStar(IceStar star, Vector2 velocity) { Stars.Remove(star); CreateStar(star.Position + new Vector2(star.HalfSize.X, star.HalfSize.Y), star.Angle); (Stars[Stars.Count - 1] as Star).Velocity = velocity; emitters[2].Position = star.Position + new Vector2(star.HalfSize.X, star.HalfSize.Y); emitters[2].Emit(); gameContext.AudioHandler.PlaySound("IceStar"); }
public void CreateIceStar(Vector2 position, float angle, int type) { var star = new IceStar(); star.Initialize(gameContext, type); star.Position = new Vector2((int)(position.X - star.HalfSize.X), (int)(position.Y - star.HalfSize.Y)); star.Angle = angle; star.CollisionRadius = 30; Stars.Add(star); }