//OK public Target(Texture2D texture, Rectangle viewSource, Point background, Point screenDim, int zRange, int radius, Color color, Texture2D sphereAtlas, Texture2D explosionAtlas) //hittingGame { this.texture = texture; this.zRange = zRange; this.color = color; this.radius = radius; this.sphereAtlas = sphereAtlas; Radius = radius; sphere = new AnimationSphere(sphereAtlas, explosionAtlas, 20); cameraDistance = (background.X - screenDim.X) / Math.PI; cameraOrig = new Point((int)cameraDistance + zRange, (int)cameraDistance + zRange); position = new Vector3(zRange + (float)cameraDistance - radius, zRange + (float)cameraDistance - radius, (float)cameraDistance + zRange / 2 - radius); rand = new Random(); vectSpeed = new Vector3(0, 0, 0); modulusSpeed = 0; timeToSpeedChange = 0; totalElapsedTimePrev = 0; totalElapsedTimeDiff = 0; gammaMax = (background.Y - screenDim.Y) / (float)cameraDistance; gammaDeltaOff = 0.5 * (Math.PI - (background.Y - screenDim.Y) / cameraDistance); CalculateSafePoints(); UpdateScale(); UpdateAngles(viewSource); }
public AnimationSphere CloneSphere() { AnimationSphere copy = (AnimationSphere)this.MemberwiseClone(); copy.isExploding = true; return(copy); }