예제 #1
0
        protected override void LoadContent( )
        {
            Debug.Print("Engine Initialized!");

            Debug.Print("Loading Content...");
            PHYSICS_WORLD.Clear( );

            //create sprite batch
            m_SpriteBatch = new SpriteBatch(GraphicsDevice);

            Debug.Print("Engine Ready!");
        }
예제 #2
0
        protected override void Update(GameTime gameTime)
        {
            var deltaTime = ( float )gameTime.ElapsedGameTime.TotalSeconds;

            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState( ).IsKeyDown(Keys.Escape))
            {
                Exit( );
            }

            //Do Physics step
            PHYSICS_WORLD.Step(Math.Min(( float )gameTime.ElapsedGameTime.TotalSeconds, (1f / 30f)));

            //Dispatch Physics Events
            if (OnPhysicsUpdate != null)
            {
                OnPhysicsUpdate(PHYSICS_WORLD);
            }

            //Update loaded scene
            WorldManager.Update(gameTime);

            base.Update(gameTime);
        }