Exemplo n.º 1
0
        /// <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);

            SuperGraphics = GraphicsDevice;

            Global.EntityAtlas = Content.Load <Texture2D>("Graphics\\entity_atlas");
            Global.MapAtlas    = Content.Load <Texture2D>("Graphics\\gonzalo_map");

            if (settings.PlaySound)
            {
                SoundEffect soundTrack = Content.Load <SoundEffect>("SoundTracks\\chaesd_by_teh_rievr");
                SoundTrack.Load(soundTrack, play: true);
            }

            match = GetMatch();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                Exit();
            }

            if (GamePad.GetState(PlayerIndex.One).Buttons.Start == ButtonState.Pressed ||
                GamePad.GetState(PlayerIndex.Two).Buttons.Start == ButtonState.Pressed ||
                Keyboard.GetState().IsKeyDown(Keys.Enter))
            {
                match = GetMatch();
            }

            InputManager.Update(gameTime);

            match.Update(gameTime);

            base.Update(gameTime);
        }