Beispiel #1
0
 public override void Update(GameTime time)
 {
     if (!UIManager.Update(time))
     {
         base.Exit();
     }
     ActiveMap.UpdateDynamicObjects(time);
     PhysicsManager.Update(time.ElapsedGameTime.Milliseconds / 1000f);
 }
Beispiel #2
0
        public override void Update(Microsoft.Xna.Framework.GameTime time)
        {
            if (!UIManager.Update(time))
            {
                base.Exit();
            }

            ActiveMap.UpdateDynamicObjects(time);
            PhysicsManager.Update(time.ElapsedGameTime.Milliseconds / 1000f);
            PlayerProfile.UpdateTime(time.ElapsedGameTime);
        }
Beispiel #3
0
 public override void Update(GameTime time)
 {
     if (!UIManager.Update(time)) // Allows exit event to close game
     {
         base.Exit();
     }
     ActiveMap.UpdateDynamicObjects(time);
     PhysicsManager.Update(time.ElapsedGameTime.Milliseconds / 10f);
     if (PlayerManger.Health <= 0)
     {
         this.EndGame();
     }
 }
Beispiel #4
0
        public override void Update(GameTime time)
        {
            if (!UIManager.Update(time))
            {
                base.Exit();
            }
            ActiveMap.UpdateDynamicObjects(time);
            PhysicsManager.Update(time.ElapsedGameTime.Milliseconds / 1000f);

            if (!time.IsRunningSlowly)
            {
                dint -= time.ElapsedGameTime.Milliseconds / 1000f;
                if (dint <= 0.0f)
                {
                    dynamic obj;
                    if (MathUtils.Rand.Next(0, 2) == 0)
                    {
                        obj = new BombRoid(new Vector2((float)MathUtils.Rand.Next(60, (int)winSize.Width - 60), (float)MathUtils.Rand.Next(60, (int)winSize.Height - 60)), MathUtils.Rand.Next(2, 10));
                    }
                    else
                    {
                        obj = new InertRoid(new Vector2((float)MathUtils.Rand.Next(60, (int)winSize.Width - 60), (float)MathUtils.Rand.Next(60, (int)winSize.Height - 60)), MathUtils.Rand.Next(2, 10));
                    }
                    obj.Velocity = 1000 * (float)MathUtils.Rand.NextDouble() * MathUtils.RandDirection();
                    PhysicsManager.ActiveBodies.Add(obj);
                    ActiveMap.AddObject(obj);

                    Console.WriteLine(PhysicsManager.ActiveBodies.Count.ToString() + " bodies");
                    dint = delay;
                }
            }
            else
            {
                Console.Write(PhysicsManager.ActiveBodies.Count.ToString() + " bodies     ");
                Console.WriteLine("SLOW - HIT PERIOD TO DISABLE GRFX");
                dint = 0.0f;
            }
        }