Ejemplo n.º 1
0
 /// <summary>
 /// UnloadContent will be called once per game and is the place to unload
 /// game-specific content.
 /// </summary>
 protected override void UnloadContent()
 {
     Content.Unload();
     _graphics.Dispose();
     _spriteBatch.Dispose();
     _outputTexture.Dispose();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// UnloadContent will be called once per game and is the place to unload
 /// game-specific content.
 /// </summary>
 protected override void UnloadContent()
 {
     // TODO: Unload any non ContentManager content here
     //qbatch.Dispose();
     sbatch.Dispose();
     graphics.Dispose();
 }
Ejemplo n.º 3
0
 protected override void UnloadContent()
 {
     base.UnloadContent();
     whiteRectangle.Dispose();
     spriteBatch.Dispose();
     graphicsDeviceManager.Dispose();
 }
Ejemplo n.º 4
0
        protected GameTestBase()
        {
            ConsoleLogMode = ConsoleLogMode.Always;

            // Override the default graphic device manager
            GraphicsDeviceManager.Dispose();
            GraphicsDeviceManager = new TestGraphicsDeviceManager(this)
            {
                PreferredBackBufferWidth    = 800,
                PreferredBackBufferHeight   = 480,
                PreferredDepthStencilFormat = PixelFormat.D24_UNorm_S8_UInt,
                DeviceCreationFlags         = DeviceCreationFlags.Debug,
                PreferredGraphicsProfile    = new[] { GraphicsProfile.Level_9_1 }
            };
            Services.AddService <IGraphicsDeviceManager>(GraphicsDeviceManager);
            Services.AddService <IGraphicsDeviceService>(GraphicsDeviceManager);

            StopOnFrameCount        = -1;
            AutoLoadDefaultSettings = false;

            FrameGameSystem = new FrameGameSystem(Services);
            GameSystems.Add(FrameGameSystem);

            // by default we want the same size for the back buffer on mobiles and windows.
            BackBufferSizeMode = BackBufferSizeMode.FitToDesiredValues;
        }
Ejemplo n.º 5
0
        protected override void UnloadContent()
        {
            if (audio != null)
            {
                //audio.Pause();
                audio.Dispose();
            }

            skeletonMeshRenderer.End();

            _DxDeviceManager.EndDraw();
            _DxDeviceManager.Dispose();


            mapObjects_NPCs.Clear();
            mapObjects_Mobs.Clear();
            mapObjects_Reactors.Clear();
            mapObjects_Portal.Clear();

            backgrounds_front.Clear();
            backgrounds_back.Clear();

            texturePool.Dispose();

            // clear prior mirror bottom boundary
            rect_mirrorBottom      = new Rectangle();
            mirrorBottomReflection = null;
        }
        protected override void UnloadContent()
        {
            // TODO: Unload any non ContentManager content here
            skeletonRenderer.End();

            graphicsDeviceMgr.EndDraw();
            graphicsDeviceMgr.Dispose();
            graphicsDeviceMgr = null;
        }
Ejemplo n.º 7
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                _graphicsDeviceManager.Dispose();
            }

            base.Dispose(disposing);
        }
        protected override void UnloadContent()
        {
            // TODO: Unload any non ContentManager content here
            graphicsDeviceMgr.EndDraw();
            graphicsDeviceMgr.Dispose();
            graphicsDeviceMgr = null;

            dxDrawableItem = null;
        }
Ejemplo n.º 9
0
 protected override void UnloadContent()
 {
     graphics.Dispose();
     spriteBatch.Dispose();
     bacground.Dispose();
     gameUI   = null;
     gamePlay = null;
     GC.Collect();
 }
Ejemplo n.º 10
0
        protected override void Dispose(bool disposing)
        {
            SpriteBatch?.Dispose();
            renderSurface?.Dispose();
            graphics.Dispose();
            AudioManager?.Dispose();

            base.Dispose(disposing);
        }
Ejemplo n.º 11
0
        protected override void OnExiting(object sender, EventArgs args)
        {
            _renderer.Dispose();
            _frameBuffer.Dispose();
            _spriteBatch.Dispose();
            _deviceManager.Dispose();

            base.OnExiting(sender, args);
        }
Ejemplo n.º 12
0
        protected override void Dispose(bool disposing)
        {
            _runner.Dispose();
            _world.Dispose();
            _system.Dispose();
            _square.Dispose();
            _batch.Dispose();
            _deviceManager.Dispose();

            base.Dispose(disposing);
        }
Ejemplo n.º 13
0
            protected override void Dispose(bool disposing)
            {
                if (BackBuffer != null)
                {
                    BackBuffer.Dispose();
                    BackBuffer = null;
                }

                DeviceManager.Dispose();
                base.Dispose(disposing);
            }
Ejemplo n.º 14
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                _graphics.Dispose();
                _lineBatch.Dispose();
                _quadRenderer.Dispose();
                _spriteBatch.Dispose();
            }

            base.Dispose(disposing);
        }
Ejemplo n.º 15
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                _graphics.Dispose();
                _batch.Dispose();
                _circleSprite.Dispose();
                _groundSprite.Dispose();
            }

            base.Dispose(disposing);
        }
Ejemplo n.º 16
0
        protected override void UnloadContent()
        {
            if (audio != null)
            {
                //audio.Pause();
                audio.Dispose();
            }

            skeletonMeshRenderer.End();

            _DxDeviceManager.EndDraw();
            _DxDeviceManager.Dispose();
        }
Ejemplo n.º 17
0
        protected GameTestBase()
        {
            // Override the default graphic device manager
            GraphicsDeviceManager.Dispose();
            GraphicsDeviceManager = new TestGraphicsDeviceManager(this)
            {
                PreferredBackBufferWidth    = 800,
                PreferredBackBufferHeight   = 480,
                PreferredDepthStencilFormat = PixelFormat.D24_UNorm_S8_UInt,
                DeviceCreationFlags         = DeviceCreationFlags.Debug,
                PreferredGraphicsProfile    = new[] { GraphicsProfile.Level_9_1 }
            };
            Services.AddService(typeof(IGraphicsDeviceManager), GraphicsDeviceManager);
            Services.AddService(typeof(IGraphicsDeviceService), GraphicsDeviceManager);

            // Enable profiling
            //Profiler.EnableAll();

            CurrentVersion          = 0;
            StopOnFrameCount        = -1;
            AutoLoadDefaultSettings = false;

            FrameGameSystem = new FrameGameSystem(Services);
            GameSystems.Add(FrameGameSystem);

            // by default we want the same size for the back buffer on mobiles and windows.
            BackBufferSizeMode = BackBufferSizeMode.FitToDesiredValues;

#if SILICONSTUDIO_PLATFORM_WINDOWS_DESKTOP
            // get build number
            int buildNumber;
            if (ImageTester.ImageTestResultConnection.BuildNumber <= 0 && int.TryParse(Environment.GetEnvironmentVariable("XENKO_BUILD_NUMBER"), out buildNumber))
            {
                ImageTester.ImageTestResultConnection.BuildNumber = buildNumber;
            }

            // get branch name
            if (string.IsNullOrEmpty(ImageTester.ImageTestResultConnection.BranchName))
            {
                ImageTester.ImageTestResultConnection.BranchName = Environment.GetEnvironmentVariable("XENKO_BRANCH_NAME") ?? "";
            }
#endif

            SceneSystem.SplashScreenEnabled = false;
        }
        protected override void UnloadContent()
        {
            if (audio != null)
            {
                //audio.Pause();
                audio.Dispose();
            }

            skeletonMeshRenderer.End();

            _DxDeviceManager.EndDraw();
            _DxDeviceManager.Dispose();


            mapObjects_NPCs.Clear();
            mapObjects_Mobs.Clear();
            mapObjects_Reactors.Clear();
            mapObjects_Portal.Clear();

            backgrounds_front.Clear();
            backgrounds_back.Clear();

            texturePool.Dispose();
        }
Ejemplo n.º 19
0
        protected override void Update(GameTime gameTime)
        {
            //Check for finish

            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape) || !IsActive)
            {
                _graphics.Dispose();
                IsGameFinished = true;
                TimeTaken      = 0;
                Close();
            }


            //Handle Enemy Graphics


            if (m_NewestUpdate != null)
            {
                Vector2 OppositionPos = m_CompetitorsAndObjects[0].ReturnLocale();
                OppositionPos.X = m_NewestUpdate.m_PaddlePosX;
                m_CompetitorsAndObjects[0].Update(m_NewestUpdate.m_PaddlePosX);
                Vector2 CurrentBallPos        = new Vector2(m_NewestUpdate.m_BallX, m_NewestUpdate.m_BallY);
                Vector2 SuspectedBallPosition = new Vector2(OppositionPos.X + 150, OppositionPos.Y - 46);

                if (CurrentBallPos != SuspectedBallPosition && CurrentBallPos.Y > SuspectedBallPosition.Y + 5 || CurrentBallPos.Y < SuspectedBallPosition.Y - 5)
                {
                    if (!m_CompetitorsAndObjects[1].Active)
                    {
                        m_CompetitorsAndObjects[1].Active = true;
                    }
                    else
                    {
                        m_CompetitorsAndObjects[1].MoveY(-3);
                    }
                }
                else
                {
                    SuspectedBallPosition.X          -= 150;
                    SuspectedBallPosition.Y          += 46;
                    m_CompetitorsAndObjects[1].Active = false;
                    m_CompetitorsAndObjects[1].SetBallPos(SuspectedBallPosition);
                }

                for (int i = 0; i < m_CompetitorBricks.Count; i++)
                {
                    if (m_NewestUpdate.m_BrickState[i])
                    {
                        m_CompetitorBricks[i].Active = true;
                    }
                    else
                    {
                        m_CompetitorBricks[i].Active = false;
                    }
                }
            }



            //Handle local
            m_PlayerAndObjects[1].UpdateRectangle(m_PlayerAndObjects[1].ReturnLocale());
            if (Keyboard.GetState().IsKeyDown(Keys.Space))
            {
                m_PlayerAndObjects[1].Active = true;
            }
            else if (!m_PlayerAndObjects[1].Active)
            {
                m_PlayerAndObjects[1].SetBallPos(m_PlayerAndObjects[0].ReturnLocale());
            }
            else
            {
                m_PlayerAndObjects[1].MoveY(-3);
                if (m_PlayerAndObjects[1].ReturnLocale().Y < -10)
                {
                    m_PlayerAndObjects[1].Active = false;
                }
            }

            if (Keyboard.GetState().IsKeyDown(Keys.A))
            {
                m_PlayerAndObjects[0].MoveX(-1);
            }
            if (Keyboard.GetState().IsKeyDown(Keys.D))
            {
                m_PlayerAndObjects[0].MoveX(1);
            }

            //Collision
            if (m_PlayerAndObjects[1].Active)
            {
                for (int i = 0; i < m_Bricks.Count; i++)
                {
                    if (m_Bricks[i].Active)
                    {
                        if (m_Bricks[i].CheckForCollision(m_Bricks[i], m_PlayerAndObjects[1]))
                        {
                            m_Bricks[i].Active           = false;
                            m_PlayerAndObjects[1].Active = false;
                        }
                    }
                }
            }

            List <bool> CheckIfCompleted = new List <bool>();
            int         truecount        = 0;

            for (int i = 0; i < m_Bricks.Count; i++)
            {
                if (!m_Bricks[i].Active)
                {
                    CheckIfCompleted.Add(false);
                    truecount++;
                }
                else
                {
                    CheckIfCompleted.Add(true);
                }
            }
            if (truecount == m_Bricks.Count - 2)
            {
                TimeTaken      = (int)gameTime.TotalGameTime.TotalSeconds;
                m_Finished     = new Packets.GameFinished(TimeTaken);
                IsGameFinished = true;
                if (Submitted)
                {
                    Close();
                }
            }
            Packets.GameUpdate GU = new Packets.GameUpdate((int)m_PlayerAndObjects[0].ReturnLocale().X, (int)m_PlayerAndObjects[1].ReturnLocale().X, (int)m_PlayerAndObjects[1].ReturnLocale().Y, CheckIfCompleted);
            m_CurrentObjects = GU;
            base.Update(gameTime);
        }
Ejemplo n.º 20
0
 protected override void Dispose(bool disposing)
 {
     SceneManager.Instance.Clear();
     _deviceManager.Dispose();
     base.Dispose(disposing);
 }