testBall.XVelocity = (Microsoft.Xna.Framework.Input.GamePad.GetState(PlayerIndex.One).ThumbSticks.Left.X)*10; testBall.YVelocity = (Microsoft.Xna.Framework.Input.GamePad.GetState(PlayerIndex.One).ThumbSticks.Left.Y) * 10; FlatRedBall.Math.Geometry.Point[] pointArray; pointArray = new FlatRedBall.Math.Geometry.Point[5]; float rightY = Microsoft.Xna.Framework.Input.GamePad.GetState(PlayerIndex.One).ThumbSticks.Right.Y; float rightX = Microsoft.Xna.Framework.Input.GamePad.GetState(PlayerIndex.One).ThumbSticks.Right.X; pointArray[0] = new FlatRedBall.Math.Geometry.Point(0, 1); if (20 * ((Math.Abs(rightX)) + Math.Abs(rightY)) / 2 < 10) { pointArray[1] = new FlatRedBall.Math.Geometry.Point(20 * ((Math.Abs(rightX)) + Math.Abs(rightY)) / 2, 1); pointArray[2] = new FlatRedBall.Math.Geometry.Point(20 * ((Math.Abs(rightX)) + Math.Abs(rightY)) / 2, -1); } else { pointArray[1] = new FlatRedBall.Math.Geometry.Point(10, 1); pointArray[2] = new FlatRedBall.Math.Geometry.Point(10, -1); } pointArray[3] = new FlatRedBall.Math.Geometry.Point(0, -1); pointArray[4] = pointArray[0]; beamPoly.Points = pointArray; if (Microsoft.Xna.Framework.Input.GamePad.GetState(PlayerIndex.One).ThumbSticks.Right.X > 0) beamPoly.RelativeRotationZ = rightY * (float)Math.PI / 2; else beamPoly.RelativeRotationZ = -1*(rightY * (float)Math.PI / 2)+(float)Math.PI;