/// <summary> /// Load graphics content for the game. /// </summary> public override void Activate(InputState input) { grid = new DrawableGrid(3); landscape = new Landscape(); effectSprites = new List<EffectSprite>(); //for (int i = 0; i < Main.backgroundLoops.Count; i++) //Main.backgroundLoops[i].Play(); scoreText = new IconText("", Main.sprites["points"], new Vector2(Main.windowSize.X / 10.0f, Main.windowSize.X / 10.0f), new Vector2(Main.windowSize.X / 6.0f, Main.windowSize.X / 12.0f), 0.5f, Color.Goldenrod, TextAlignment.Right); snake = new Snake(grid, Main.windowSize * 0.5f, this.snakeSpeed, this.startSnakeLength); landscape.AddComponent(snake); List<Type> snakeConditions = new List<Type>(); snakeConditions.Add(typeof(Mouse)); snakeConditions.Add(typeof(Rabbit)); snake.ScheduleCollisionHandling(snakeConditions); animals = new List<IDrawableGridAsset>(); for (int i = 0; i < 5; i++) this.PlaceAnimal(); ScreenManager.Game.ResetElapsedTime(); base.Activate(input); }
/// <summary> /// Load graphics content for the game. /// </summary> /// public override void Activate(InputState input) { grid = new DrawableGrid(3); landscape = new Landscape(); effectSprites = new List<EffectSprite>(); //for (int i = 0; i < Main.backgroundLoops.Count; i++) //Main.backgroundLoops[i].Play(); scoreText = new IconText("", Main.sprites["points"], new Vector2(Main.windowSize.X / 15.0f, Main.windowSize.X / 15.0f), new Vector2(Main.windowSize.X / 6.0f, 100.0f), 0.5f, Color.Goldenrod, TextAlignment.Right); quadrantTarget = Main.numGenerator.Next() % 4 + 1; if (currentExcercise == QuadrantExcercises.PolarityOne || currentExcercise == QuadrantExcercises.PolarityTwo) quadrantCommand = new IconText(Utilities.QuadrantToPolarity(quadrantTarget), Main.sprites["quadrant"], new Vector2(Main.windowSize.X / 10.0f, Main.windowSize.X / 10.0f), new Vector2(Main.windowSize.X / 3.0f, 100), 1.0f, Color.Azure, TextAlignment.Right, TextEffect.Bubble); else quadrantCommand = new IconText(quadrantTarget.ToString(), Main.sprites["quadrant"], new Vector2(Main.windowSize.X / 10.0f, Main.windowSize.X / 10.0f), new Vector2(Main.windowSize.X / 3.0f, 100), 1.0f, Color.Azure, TextAlignment.Right, TextEffect.Bubble); resultText = new Text("", new Vector2(Main.windowSize.X / 2.0f, Main.windowSize.X / 10.0f), Main.windowSize.X / 1920.0f, Color.Red, TextEffect.Fade); this.lives = 5; lifeSprites = new List<DrawableAsset<Texture2D>>(); Vector2 lifeSpriteSize = new Vector2(Main.windowSize.X / 15.0f, Main.windowSize.X / 15.0f); for (int i = 0; i < lives; i++) lifeSprites.Add(new DrawableAsset<Texture2D>(new Vector2(Main.windowSize.X - (i + 1) * lifeSpriteSize.X, lifeSpriteSize.Y), new Vector2(0, -1), lifeSpriteSize, Main.sprites["snakeBody"])); landscape.AddStain(new CoordinateSystem(coordinateType)); snake = new Snake(grid, Main.windowSize * 0.5f, this.snakeSpeed, this.startSnakeLength); landscape.AddComponent(snake); animals = new List<IDrawableGridAsset>(); for (int i = 0; i < 4; i++) this.PlaceAnimal(i + 1); List<Type> snakeConditions = new List<Type>(); snakeConditions.Add(typeof(Mouse)); snakeConditions.Add(typeof(Rabbit)); snake.ScheduleCollisionHandling(snakeConditions); //ScreenManager.Game.ResetElapsedTime(); base.Activate(input); }