Example #1
0
        public override void Update()
        {
            if (InputEngine.IsKeyHeld(Keys.A))
            {
                World *= Matrix.CreateTranslation(new Vector3(-speed, 0, 0));
            }
            else if (InputEngine.IsKeyHeld(Keys.D))
            {
                World *= Matrix.CreateTranslation(new Vector3(speed, 0, 0));
            }

            if (InputEngine.IsKeyHeld(Keys.W))
            {
                World *= Matrix.CreateTranslation(new Vector3(0, 0, -speed));
            }
            else if (InputEngine.IsKeyHeld(Keys.S))
            {
                World *= Matrix.CreateTranslation(new Vector3(0, 0, speed));
            }

            if (InputEngine.IsKeyHeld(Keys.E))
            {
                World *= Matrix.CreateTranslation(new Vector3(0, speed, 0));
            }
            else if (InputEngine.IsKeyHeld(Keys.Q))
            {
                World *= Matrix.CreateTranslation(new Vector3(0, -speed, 0));
            }

            UpdateView();
            base.Update();
        }
Example #2
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferWidth = 1440;
            graphics.PreferredBackBufferHeight = 800;
            graphics.ApplyChanges();

            input = new InputEngine(this);
            debug = new DebugEngine();
            shapeDrawer = new ImmediateShapeDrawer();

            IsMouseVisible = true;
            Content.RootDirectory = "Content";
        }