Пример #1
0
        // Game loop
        private void Timer_Tick(object sender, object e)
        {
            // Move butterfly if up pressed
            if (UpPressed)
            {
                butterfly.Move();
            }

            // Rotate butterfly is left/right pressed
            // -1 == left, 1 == right
            if (LeftPressed)
            {
                butterfly.Rotate(-1);
            }
            if (RightPressed)
            {
                butterfly.Rotate(1);
            }

            // Update butterfly
            butterfly.SetLocation();

            // Collision...
            CheckCollision();
        }
Пример #2
0
        //game loop
        private void Timer_Tick(object sender, object e)
        {
            // Move butterfly if up pressed
            if (UpPressed)
            {
                butterfly.Move();
            }

            // Rotate butterfly if left/right pressed
            if (LeftPressed)
            {
                butterfly.Rotate(-1);                // -1 == left
            }
            if (RightPressed)
            {
                butterfly.Rotate(1);                 //  1 == right
            }
            // Update butterfly , Perhosen paikka Canvaksella päivitetään
            butterfly.SetLocation();

            // Collision...
            CheckCollision();
        }
Пример #3
0
        //game loop
        private void Timer_Tick(object sender, object e)
        {
            //move butterfly if pressed up
            if (UpPressed)
            {
                butterfly.Move();
            }

            //rotate if left or right pressed
            if (LeftPressed)
            {
                butterfly.Rotate(-1);             // -1 == left , 1 == right
            }
            if (RightPressed)
            {
                butterfly.Rotate(1);
            }

            //update butterfly
            butterfly.SetLocation();

            //Collision
            CheckCollision();
        }