Beispiel #1
0
    void Update()
    {
        float frameTime = Time.deltaTime;

        accumulator += frameTime;

        while (accumulator >= dt)
        {
            meshpool.UpdateAt(dt);                      // Movement
            meshpool.ReferenceBullets();                // Reference bullets for collisions

            // Collisions checks
            player.UpdateAt(dt);

            if (dialogue.in_dialogue == false)
            {
                for (int i = 0; i < enemies.Length; ++i)
                {
                    enemies [i].UpdateAt(dt);
                }
            }

            accumulator -= dt;
            t           += dt;
        }
    }
Beispiel #2
0
    void Update()
    {
        player.UpdateAt();
        //dialogue.UpdateAt();

        float frameTime = Time.deltaTime;

        accumulator += frameTime;

        while (accumulator >= dt)
        {
            meshpool.UpdateAt(dt);                      // Movement
            meshpool.ReferenceBullets();                // Reference bullets for collisions

            // Collisions checks
            player.UpdateAt();
            for (int i = 0; i < enemies.Count; ++i)
            {
                enemies[i].UpdateAt(dt);
            }

            accumulator -= dt;
            t           += dt;
        }

        /*float alpha = accumulator / dt;
         * meshpool.PrepareRendering(alpha);*/
    }