コード例 #1
0
ファイル: WardeclarerScript.cs プロジェクト: cookgreen/WDC
 public void Render(Graphics g, IRenderer renderer)
 {
     if (counter >= 0 && counter <= 35)
     {
         //Hello Comrade
         text1.Draw(g);
     }
     else if (counter > 35 && counter <= 70)
     {
         //Which country do you wanna destroy today
         text2.Draw(g);
     }
     else if (!clicked)
     {
         engine.AddIfNotExisted(option1);
         engine.AddIfNotExisted(option2);
     }
     else if (counter > counter2 && counter <= counter2 + 20)
     {
         text3.Draw(g);
     }
     else if (counter > counter2 + 20 && !reached)
     {
         missile.Render(g, renderer);
     }
     else if (counter > counter2 + 20 && deadline >= 0)
     {
         cloud.Render(g, renderer);
         deadline--;
     }
     else if (counter > counter2 + 20)
     {
         ShutdownShowMessage?.Invoke("Program wardeclarer.exe has stopped working\r\nbecause you are f*****g capitalist!", "wardeclarer.exe");
     }
     counter++;
 }
コード例 #2
0
        public void Render(Graphics g, IRenderer renderer)
        {
            if (counter >= 0 && counter <= 35)
            {
                //Ready
                text1.Draw(g);
            }
            else if (counter > 35 && counter <= 70)
            {
                //Go!
                text2.Draw(g);
                started = true;
            }
            else if (score <= 0)
            {
                ShutdownShowMessage?.Invoke("游戏结束!", "wardeclarer.exe");
            }
            else if (waitingForInput)
            {
                txtGarbageCurrent.Text = "当前: " + currentGarbage.Name;
                txtGarbageCurrent.Draw(g);
                text3.Draw(g);

                if (showCurrentAnswer)
                {
                    txtGarbageCurrentAnswer.Text = "答案: 选择第" + (((int)currentGarbage.Box) + 1).ToString() + "个";
                    txtGarbageCurrentAnswer.Draw(g);
                }
            }
            else if (currentResult != 0)
            {
                if (currentResult == 1)
                {
                    text5.Draw(g);
                    lastGameObject = text5;
                    delay          = 10;
                    currentResult  = 0;
                }
                else if (currentResult == 2)
                {
                    text4.Draw(g);
                    lastGameObject = text4;
                    delay          = 10;
                    currentResult  = 0;
                }
            }
            else if (delay > 0)
            {
                if (lastGameObject != null)
                {
                    lastGameObject.Render(g, renderer);
                }
                delay--;
            }
            else
            {
                int randIndex = rand.Next(0, garbages.Count);
                currentGarbage  = garbages[randIndex];
                waitingForInput = true;

                txtScoreValue.Text = score.ToString();
            }
            counter++;
        }