コード例 #1
0
 public void Update(int tickCount)
 {
     if (wc != null && tickCount > (FPS * delay))
     {
         int frameCount = tickCount % ((int)(FPS * delay));
         if (frameCount == (tickCount / ((int)(FPS * delay))))
         {
             wc.AddWaterBlock(new Point(conteinerPosition.X, conteinerPosition.Y - ((frameCount - 1) * 22)));
         }
     }
     if (c != null)
     {
         c.Move();
     }
 }
コード例 #2
0
ファイル: myForm.cs プロジェクト: Zamk/WinFormsTest
        private void TimerTick(object sender, EventArgs e)
        {
            if (wc != null && tickCount > (FPS * delay))
            {
                frameCount = tickCount % ((int)(FPS * delay));
                if (frameCount == (tickCount / ((int)(FPS * delay))))
                {
                    wc.AddWaterBlock(new Point(conteinerPositionX, conteinerPositionY - ((frameCount - 1) * 22)));
                }
            }
            if (c != null)
            {
                c.Move();
            }

            this.Refresh();
            tickCount++;
        }