예제 #1
0
파일: StarHandler.cs 프로젝트: JohanGl/Moon
        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");
        }
예제 #2
0
파일: StarHandler.cs 프로젝트: JohanGl/Moon
        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);
        }