Example #1
0
        public void Update()
        {
            foreach (Entity e in LiveEntities)
            {
                e.Update();
            }

            if (game.mouseInputHandler.IsLeftDown())
            {
                testWeapon.Fire();
            }
            testWeapon.Update(game.mouseInputHandler.GetRealMousePos());

            int count = bullets.Count;

            for (int i = 0; i < count; i++)
            {
                Bullet b = bullets[i];
                if (b.canDestroy)
                {
                    bullets.Remove(bullets[i]);
                    count--;
                    i--;
                }
                b.Update();
            }

            camera.SetPosition(player.GetOrigin());
        }