protected override void Initialize() { // LoadGraphicsContent(true); // MediaPlayer.Play(mysong); box = new mygame.Graphics.Image[4]; for (int i = 0; i < Max_Obj; i++) { box[i] = new mygame.Graphics.Image(); } Mouse.Initialize(); this.cameraPosition = new Microsoft.Xna.Framework.Vector3(0.0f, 0.0f, 30.0f); this.aspectRatio = (float)graphics.GraphicsDevice.Viewport.Width / (float)graphics.GraphicsDevice.Viewport.Height; this.aspectRatio = 1.0f; this.sphereRotation = 0.0f; this.arrow = new mygame.Graphics.Image(); //Initializing the Position Color and Scale of the boxes. //Fixing 4 positions and giving them random colors and scales int j = 100; Color c1 = new Color(Color.Red, 255); Color c2 = new Color(Color.White, 255); Color c3 = new Color(Color.Green, 255); Color c4 = new Color(Color.Blue, 255); Rectangle rect = new Rectangle(0, 0, 220, 220); for (int i = 0; i < Max_Obj; i++) { randomNo = ((float)GenRandom() * 10) % 2; randomNo = randomNo < 1 ? 1 : randomNo; if (i == 0) { box[i].Initialize(new Vector2(100, 500), c1, new Vector2((float)0.3), rect); } else if (i == 1) { box[i].Initialize(new Vector2(250, 500), c2, new Vector2((float)0.48), rect); } else if (i == 2) { box[i].Initialize(new Vector2(400, 500), c3, new Vector2((float)0.25), rect); } else if (i == 3) { box[i].Initialize(new Vector2(550, 500), c4, new Vector2((float)0.4), rect); } } keepAt = new Vector2(300, 400 - 120); randomNo = (float)GenRandom(); y1 = (float)randomNo; x1 = 1f; m = y1 / x1; base.Initialize(); }
protected override void Initialize() { // LoadGraphicsContent(true); // MediaPlayer.Play(mysong); box = new mygame.Graphics.Image[4]; for (int i = 0; i < Max_Obj; i++) { box[i] = new mygame.Graphics.Image(); } Mouse.Initialize(); this.cameraPosition = new Microsoft.Xna.Framework.Vector3(0.0f, 0.0f, 30.0f); this.aspectRatio = (float)graphics.GraphicsDevice.Viewport.Width / (float)graphics.GraphicsDevice.Viewport.Height; this.aspectRatio = 1.0f; this.sphereRotation = 0.0f; this.arrow=new mygame.Graphics.Image(); //Initializing the Position Color and Scale of the boxes. //Fixing 4 positions and giving them random colors and scales int j = 100; Color c1 = new Color(Color.Red, 255); Color c2 = new Color(Color.White, 255); Color c3 = new Color(Color.Green, 255); Color c4 = new Color(Color.Blue, 255); Rectangle rect=new Rectangle(0,0,220,220); for (int i = 0; i < Max_Obj; i++) { randomNo = ((float)GenRandom() * 10) % 2; randomNo = randomNo < 1 ? 1 : randomNo; if (i == 0) box[i].Initialize(new Vector2(100, 500), c1, new Vector2((float)0.3), rect); else if (i == 1) box[i].Initialize(new Vector2(250, 500), c2, new Vector2((float)0.48),rect); else if (i == 2) box[i].Initialize(new Vector2(400, 500), c3, new Vector2((float)0.25),rect); else if (i == 3) box[i].Initialize(new Vector2(550, 500), c4, new Vector2((float)0.4),rect); } keepAt = new Vector2(300,400-120); randomNo = (float)GenRandom(); y1 = (float)randomNo; x1 = 1f; m = y1 / x1; base.Initialize(); }