Пример #1
0
        public void Update()
        {
            currentTime = stopwatch.ElapsedMilliseconds;
            deltaTime   = (currentTime - lastTime) / 1000.0f;

            timer += deltaTime;
            if (timer >= 1)
            {
                fps    = frames;
                frames = 0;
                timer -= 1;
            }
            frames++;

            tank.Update(deltaTime);
            barrel.Update(deltaTime);
            CurCenter = Program.Center;
            lastTime  = currentTime;
        }
Пример #2
0
        void GameUpdate()
        {
            currentTime = stopwatch.ElapsedMilliseconds;
            deltaTime   = (currentTime - lastTime) / 1000.0f;

            timer += deltaTime;
            if (timer >= 1)
            {
                fps    = frames;
                frames = 0;
                timer -= 1;
            }
            frames++;

            player.Update(deltaTime);

            background.Update(deltaTime);
            EnemyManager.Update(deltaTime);
            PickupManager.Update(deltaTime);
            SmokeManager.Update(deltaTime);

            CurCenter = Program.Center;
            lastTime  = currentTime;
        }