Exemplo n.º 1
0
        public override void Update(InputStates pInputStates, long pFrames)
        {
            upgradesButton.Update(pInputStates, pFrames);
            playerShip.Update(pInputStates, pFrames);

            if (pInputStates.Quit) GraphicsWindow.Instance.ShouldQuit = true;
        }
Exemplo n.º 2
0
        public override void Update(InputStates pInputStates, long pFrames)
        {
            MainTitle.Update(pInputStates, pFrames);
            NewGameButton.Update(pInputStates, pFrames);
            OptionsButton.Update(pInputStates, pFrames);
            QuitButton.Update(pInputStates, pFrames);

            if (NewGameButton.LoopResultStates.Activate) GameController.SwitchLevel(new LevelOne());
            if (QuitButton.LoopResultStates.Activate || pInputStates.Quit) GraphicsWindow.Instance.ShouldQuit = true;
        }
Exemplo n.º 3
0
        // Only current mouse position is used
        public void Add(InputStates pOther)
        {
            MouseLeft = MouseLeft || pOther.MouseLeft;
            MouseRight = MouseRight || pOther.MouseRight;
            QuickClickLeft = QuickClickLeft || pOther.QuickClickLeft;
            QuickClickRight = QuickClickRight || pOther.QuickClickRight;

            Up = Up || pOther.Up;
            Down = Down || pOther.Down;
            Left = Left || pOther.Left;
            Right = Right || pOther.Right;
            Fire = Fire || pOther.Fire;
            Secondary = Secondary || pOther.Secondary;
            Upgrade = Upgrade || pOther.Upgrade;
            Quit = Quit || pOther.Quit;
        }
Exemplo n.º 4
0
 protected override void LoopControlPhysics(InputStates pInputStates, long pFrames)
 {
     if (pInputStates.Up)
     {
         dx += 1.2f * (float)Math.Sin(MathUtil.DegreesToRadians(a));
         dy += 1.2f * (float)Math.Cos(MathUtil.DegreesToRadians(a));
     }
     if (pInputStates.Left)
     {
         da += 2.5f;
     }
     if (pInputStates.Right)
     {
         da -= 2.5f;
     }
 }
Exemplo n.º 5
0
        protected override void LoopControlPhysics(InputStates pInputStates, long pFrames)
        {
            // Exit if no hit detected
            if (pInputStates.MousePosition.X < x ||
                pInputStates.MousePosition.X >= x + width ||
                pInputStates.MousePosition.Y < y ||
                pInputStates.MousePosition.Y >= y + height)
            {
                highlight = false;
                return;
            }

            if (pInputStates.DeltaMouseLeft || pInputStates.QuickClickLeft)
            {
                LoopResultStates.Activate = true;
            }
            else
            {
                highlight = true;
            }
        }
Exemplo n.º 6
0
        public void Update(InputStates pInputStates, long pFrames)
        {
            LoopResultStates.Clear();

            // Store old position and angle
            ox = x;
            oy = y;
            odx = dx;
            ody = dy;
            oa = a;
            oda = da;

            // Overridable control and friction physics
            LoopControlPhysics(pInputStates, pFrames);
            LoopFrictionPhysics(pFrames);
            LoopCollisionPhysics(pFrames);

            AdvancePosition();

            // Update collision body
        }
Exemplo n.º 7
0
 public GraphicsWindow()
 {
     InitializeComponent();
     instance = this;
     inputStates = new InputStates();
 }
Exemplo n.º 8
0
 public abstract void Update(InputStates pInputStates, long pFrames);
Exemplo n.º 9
0
 public static void Update(InputStates pInputStates, long pFrames)
 {
     currentLevel.Update(pInputStates, pFrames);
 }
Exemplo n.º 10
0
 protected override void LoopControlPhysics(InputStates pInputStates, long pFrames)
 {
     brush.Transform = Matrix3x2.Identity;
 }
Exemplo n.º 11
0
 protected abstract void LoopControlPhysics(InputStates pInputStates, long pFrames);