Exemplo n.º 1
0
 public Game(MainChar m)
 {
     pm        = new PhysicsManager(this);
     renderman = new RenderManager();
     entities  = //new AdvancedEntityManager(128,64,32,16,8,4,2,1,0.5);
                 new AdvancedEntityManager(pm, renderman, 128, 64, 32, 16, 8, 4, 2, 1, 0.5);
     events   = new GameEventManager(this, 1000, 100, 10, 1);
     mainChar = m;
     //entities = new ListEntityManager();
     gameTimer    = new BulletHell.Time.Timer();
     curTimeRate  = 1;
     timeRateFunc = new PolyFunc <double, double>(curTimeRate);
     timeFunc     = timeRateFunc.FI;
     Add(m);
 }
Exemplo n.º 2
0
        public void GameLoop()
        {
            timer      = new BulletHell.Time.Timer();
            frameTimer = new BulletHell.Time.Timer();
            eventTimer = new BulletHell.Time.Timer();
            game.ResetTime();
            Thread renderThread = new Thread(this.ASynchGameLoop);

            renderThread.Start();
            while (this.Created)
            {
                eventTimer.Reset();
                Application.DoEvents();
                while (eventTimer.Time <= 30)
                {
                    Thread.Yield();
                }
            }
        }