示例#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();
 }
示例#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();
        }
示例#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();
 }