Esempio n. 1
0
 // game loop... 120fps
 private void Timer_Tick(object sender, object e)
 {
     if (UpPressed)
     {
         butterfly.Move();
     }
     // rotate
     if (LeftPressed)
     {
         butterfly.Rotate(-1);              // -1 == left
     }
     if (RightPressed)
     {
         butterfly.Rotate(1);               // 1 == right
     }
     // collision... flower.
     CheckCollision();
     //update
     butterfly.UpdatePosition();
 }
Esempio n. 2
0
        // game loop

        private void Timer_Tick(object sender, object e)
        {
            // move butterfly
            if (UpPressed)
            {
                butterfly.Move();
            }
            // rotate butterfly
            if (LeftPressed)
            {
                butterfly.Rotate(-1);
            }
            if (RightPressed)
            {
                butterfly.Rotate(1);
            }
            // update butterfly location
            butterfly.SetLocation();
            // collision butterfly with flowers
            CheckCollision();
        }
Esempio n. 3
0
 // Game loop
 private void Timer_Tick(object sender, object e)
 {
     // Move Butterfly
     if (UpPressed)
     {
         butterfly.Move();
     }
     // Rotate Butterfly
     //Debug.WriteLine(LeftPressed); // DEBUGGAUS
     if (LeftPressed)
     {
         butterfly.Rotate(-1);
     }
     if (RightPressed)
     {
         butterfly.Rotate(1);
     }
     // Update Butterfly location
     butterfly.SetLocation();
     // Collision Butterfly with flowers
     CheckCollission();
 }