Exemplo n.º 1
0
        static void Main()
        {
            using (var game = new MyGame())
            {
                ECSCore.Setup();
                ECSCore.Start();

                game.Run();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(bgColor);

            spriteBatch.Begin();

            // TODO: Add your drawing code here
            ECSCore.RunDisplaySystems(spriteBatch);
            ECSCore.RunUIDisplaySystems(spriteBatch);

            spriteBatch.End();

            base.Draw(gameTime);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                Exit();
            }

            Input.UpdateStates();
            this.gameTime = gameTime;

            if (Input.KeyTyped(Keys.F1))
            {
                graphics.ToggleFullScreen();
            }

            // TODO: Add your update logic here
            ECSCore.Update();

            base.Update(gameTime);
        }