Beispiel #1
0
        static void Timers_Tick(Gondwana.Common.EventArgs.TimerEventArgs e)
        {
            bool isShift = Keyboard.GetKeyDownState(Keys.ShiftKey);

            if (isShift)
            {
                return;
            }

            if (Keyboard.GetKeyDownState(Keys.Up))
            {
                sprite.SpriteMovement.AccelerationY = (-5);
            }
            else if (Keyboard.GetKeyDownState(Keys.Down))
            {
                sprite.SpriteMovement.AccelerationY = 5;
            }
            else
            {
                sprite.SpriteMovement.AccelerationY = 0;
            }

            if (Keyboard.GetKeyDownState(Keys.Left))
            {
                sprite.SpriteMovement.AccelerationX = (-2.5);
            }
            else if (Keyboard.GetKeyDownState(Keys.Right))
            {
                sprite.SpriteMovement.AccelerationX = 2.5;
            }
            else
            {
                sprite.SpriteMovement.AccelerationX = 0;
            }
        }
Beispiel #2
0
 private void Timer_Tick(TimerEventArgs e)
 {
     foreach (VisibleSurfaceBase surface in VisibleSurfaces._surfaces)
         surface.RenderBackbuffer(false);
 }