示例#1
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     doc.addPlatform();
     while (actions.Count > 0)
     {
         if (actions.Peek() == Actions.jump)
         {
             doc.Jump();
         }
         else if (actions.Peek() == Actions.melee)
         {
             doc.Melee();
         }
         else
         {
             doc.Duck();
         }
         actions.Dequeue();
     }
     doc.Move();
     if (doc.gameOver)
     {
         doc = new PlatformRunDoc(Width, Height);
     }
     ScoreStatus.Text = "Score: " + doc.score;
     KillStatus.Text  = "Kills: " + doc.kills;
     Invalidate();
 }
示例#2
0
 public Form1()
 {
     InitializeComponent();
     DoubleBuffered = true;
     paused         = false;
     actions        = new Queue <Actions>();
     WindowState    = FormWindowState.Maximized;
     KeyPreview     = true;
     doc            = new PlatformRunDoc(Width, Height - 200 - 2 * Platform.height);
     MoveTimer.Start();
 }
示例#3
0
 private void newToolStripMenuItem_Click(object sender, EventArgs e)
 {
     doc = new PlatformRunDoc(Width, Height);
 }