Пример #1
0
        private void DrawSingleElement(VisualizerInterface Visualizer, int index)
        {
            float angle = 360 / ElementCount * index + Offset;

            Vector2 elementPosition = new Vector2(
                Center.X + (float)Math.Cos(GetRadiant(angle)) * Radius,
                Center.Y + (float)Math.Sin(GetRadiant(angle)) * Radius);

            Visualizer.DrawCircle(ElementSize, elementPosition, AnimationColor);
        }
Пример #2
0
        public override void Draw(VisualizerInterface visualizer)
        {
            if (!PlayersCentered)
            {
                Center.X = visualizer.GetCenter().X;
                Initialize();
                PlayersCentered = true;
            }

            //int ballRadius = 6;
            //float BallPosX = BallPosition.X - ballRadius;
            //float BallPosY = BallPosition.Y - ballRadius;

            //SpriteBatchMain.Draw(BallTexture, new Rectangle(BallPosX, BallPosY, BallRadius * 2, BallRadius * 2), Color.Black);

            visualizer.DrawCircle(BallRadius, BallPosition, Color.Black);
            visualizer.DrawRectangle(PlayerLeft, Color.Black);
            visualizer.DrawRectangle(PlayerRight, Color.Black);
        }