/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); input = new InputHandler(); gameState = new MenuState(); gameState.LoadContent(Content); }
/// <summary> /// Loads the content and Initialize the Player's instance. /// @see Initialize /// @see AddScoreObserver /// @see StoreBullet /// </summary> /// <param name="_content">The _content.</param> public void LoadContent(ContentManager _content) { content = _content; AsteroidFactory.SetContent(_content); EnemyFactory.SetContent(_content); input = AsteroidGame.input; // Create scene LevelLoader levelLoader = new LevelLoader(level); scene = levelLoader.GetScene(); UIContainer uiContainer = new UIContainer(); uiContainer.LoadContent(content); scene.Initialize(uiContainer, content); // Player Player.GetInstance().Initialize(content, new Sprite(content.Load<Texture2D>("Graphics\\ship"), 0.6f), new Vector2(500, 300)); for (int i = 0; i < Player.MAX_NB_BULLETS; i++) { Bullet bullet = new Bullet(); bullet.Initialize(new Sprite(content.Load<Texture2D>("Graphics\\fork"), 0.4f), Player.GetInstance().Position); bullet.AddVelocity(5f); bullet.AddScoreObserver(Player.GetInstance()); Player.GetInstance().StoreBullet(bullet); } scene.AddDrawableObject(Player.GetInstance()); }
/// <summary> /// Loads the content. /// </summary> /// <param name="_content">The _content.</param> public void LoadContent(ContentManager _content) { content = _content; optionText = new string[NB_OPTION]; optionText[0] = "Play"; optionText[1] = "Leaderboard"; optionText[2] = "Exit"; input = AsteroidGame.input; }
public void LoadContent(ContentManager _content) { content = _content; input = AsteroidGame.input; }
/// <summary> /// Loads the content. /// @see GetScores /// @see ArrangeTopList /// </summary> /// <param name="_content">The _content.</param> public void LoadContent(ContentManager _content) { content = _content; scores = new List<Score>(); input = AsteroidGame.input; XMLScoreReader reader = new XMLScoreReader(); reader.Load("Scores.xml"); scores = reader.GetScores(); arrangeTopList(); }