예제 #1
0
        protected override void Update(GameTime gameTime)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                Exit();
            }

            if (Keyboard.GetState().IsKeyDown(Keys.Down))
            {
                if (_sides > 3)
                {
                    _sides--;
                    prism = new Prism(GraphicsDevice, _height, _sides);
                }
            }

            else if (Keyboard.GetState().IsKeyDown(Keys.Up))
            {
                if (_sides < 10)
                {
                    _sides++;
                    prism = new Prism(GraphicsDevice, _height, _sides);
                }
            }

            base.Update(gameTime);
        }
예제 #2
0
 protected override void LoadContent()
 {
     _spriteBatch = new SpriteBatch(GraphicsDevice);
     prism        = new Prism(GraphicsDevice, _height, _sides);
     axis         = new Axis3D(GraphicsDevice);
 }