Beispiel #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);
     cursorTexture = this.Content.Load<Texture2D>(@"cursor\cursor_normal");
     AlphaBlend = Content.Load<Effect>(@"pixelshaders\AlphaBlend");
     playfield = new HexaTest.Playfield.Playfield(21, 31, this.Content);
 }
Beispiel #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)
        {
            // Allows the game to exit
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                this.Exit();
            keyState = Keyboard.GetState();
            if(keyState.IsKeyDown(Keys.F5))
            {
                playfield = new HexaTest.Playfield.Playfield(21, 31, this.Content);
            }
            // TODO: Add your update logic here
            cursorPosition.X = Mouse.GetState().X;
            cursorPosition.Y = Mouse.GetState().Y;

            base.Update(gameTime);
        }