Ejemplo n.º 1
0
        public override void OnKeyDown(AGG.UI.KeyEventArgs keyEvent)
        {
            if (keyEvent.KeyCode == Keys.Space)
            {
                T cx = m_quad.xn(0).Add(m_quad.xn(1)).Add(m_quad.xn(2)).Add(m_quad.xn(3)).Divide(4);
                T cy = m_quad.yn(0).Add(m_quad.yn(1)).Add(m_quad.yn(2)).Add(m_quad.yn(3)).Divide(4);
                IAffineTransformMatrix <T> tr = MatrixFactory <T> .NewTranslation(cx.Negative(), cy.Negative());

                tr.RotateAlong(MatrixFactory <T> .CreateVector2D(0, 0), (Math.PI / 2.0));
                tr.Translate(MatrixFactory <T> .CreateVector2D(cx, cy));
                T xn0 = m_quad.xn(0); T yn0 = m_quad.yn(0);
                T xn1 = m_quad.xn(1); T yn1 = m_quad.yn(1);
                T xn2 = m_quad.xn(2); T yn2 = m_quad.yn(2);
                T xn3 = m_quad.xn(3); T yn3 = m_quad.yn(3);
                tr.Transform(ref xn0, ref yn0);
                tr.Transform(ref xn1, ref yn1);
                tr.Transform(ref xn2, ref yn2);
                tr.Transform(ref xn3, ref yn3);
                m_quad.SetXN(0, xn0); m_quad.SetYN(0, yn0);
                m_quad.SetXN(1, xn1); m_quad.SetYN(1, yn1);
                m_quad.SetXN(2, xn2); m_quad.SetYN(2, yn2);
                m_quad.SetXN(3, xn3); m_quad.SetYN(3, yn3);
                force_redraw();
            }

            base.OnKeyDown(keyEvent);
        }
Ejemplo n.º 2
0
 public override void OnKeyUp(AGG.UI.KeyEventArgs keyEvent)
 {
     foreach (Player aPlayer in playfield.PlayerList)
     {
         aPlayer.KeyUp(keyEvent);
     }
     base.OnKeyUp(keyEvent);
 }
Ejemplo n.º 3
0
        public override void OnKeyDown(AGG.UI.KeyEventArgs keyEvent)
        {
            if (keyEvent.KeyCode == Keys.F6)
            {
                // launch the editor
            }

            base.OnKeyDown(keyEvent);
        }
Ejemplo n.º 4
0
        public override void OnKeyDown(AGG.UI.KeyEventArgs keyEvent)
        {
            m_Playfield.Player.KeyDown(keyEvent);

            if (keyEvent.Control && keyEvent.KeyCode == Keys.S)
            {
                m_Playfield.SaveXML("TestSave");
            }

            base.OnKeyDown(keyEvent);
        }
Ejemplo n.º 5
0
        public override void OnKeyDown(AGG.UI.KeyEventArgs keyEvent)
        {
            foreach (Player aPlayer in playfield.PlayerList)
            {
                aPlayer.KeyDown(keyEvent);
            }

            if (keyEvent.Control && keyEvent.KeyCode == Keys.S)
            {
                playfield.SaveXML("TestSave");
            }

            base.OnKeyDown(keyEvent);
        }
Ejemplo n.º 6
0
        public override void OnKeyDown(AGG.UI.KeyEventArgs keyEvent)
        {
            T dx = M.Zero <T>();
            T dy = M.Zero <T>();

            switch (keyEvent.KeyCode)
            {
            case Keys.Left: dx = M.New <T>(-0.1); break;

            case Keys.Right: dx = M.New <T>(0.1); break;

            case Keys.Up: dy = M.New <T>(0.1); break;

            case Keys.Down: dy = M.New <T>(-0.1); break;
            }
            m_x[0].AddEquals(dx);
            m_y[0].AddEquals(dy);
            m_x[1].AddEquals(dx);
            m_y[1].AddEquals(dy);
            force_redraw();
            base.OnKeyDown(keyEvent);
        }
Ejemplo n.º 7
0
 public override void OnKeyUp(AGG.UI.KeyEventArgs keyEvent)
 {
     base.OnKeyUp(keyEvent);
 }
Ejemplo n.º 8
0
 public override void OnKeyUp(AGG.UI.KeyEventArgs keyEvent)
 {
     m_Playfield.Player.KeyUp(keyEvent);
     base.OnKeyUp(keyEvent);
 }
Ejemplo n.º 9
0
        public void KeyUp(KeyEventArgs keyEvent)
        {
            if (keyEvent.KeyCode == leftKey ||
                keyEvent.KeyCode == rightKey)
            {
                moveDir.x = 0;
            }

            if (keyEvent.KeyCode == downKey || keyEvent.KeyCode == upKey)
            {
                moveDir.y = 0;
            }
        }
Ejemplo n.º 10
0
        public void KeyDown(KeyEventArgs keyEvent)
		{
            if (keyEvent.KeyCode == leftKey)
            {
                moveDir.x = -1;
            }
            else
            {
                if (keyEvent.KeyCode == rightKey)
                {
                    moveDir.x = 1;
                }
            }
            if (keyEvent.KeyCode == downKey)
            {
                moveDir.y = -1;
            }
            else
            {
                if (keyEvent.KeyCode == upKey)
                {
                    moveDir.y = 1;
                }
            }
        }