예제 #1
0
        public GameForm() : base()
        {
            this.DragEnter += new System.Windows.Forms.DragEventHandler(this.GameForm_DragDrop);

            this.Text = "SpriteEditor - untitled scene";

            camera = new SpriteEditor.SEPositionedObjects.EditorCamera(FlatRedBallServices.GlobalContentManager);
            SpriteManager.Cameras[0]    = camera;
            camera.DestinationRectangle =
                new Rectangle(0, 0, FlatRedBallServices.ClientWidth, FlatRedBallServices.ClientHeight);
            camera.FixAspectRatioYConstant();

            if (this.IsDisposed)
            {
                return;
            }

            // this is a little different than what is normally done in the FRBTemplate;
            // instead of using the SpriteManager's regularly created Camera, make a new
            // EditorCamera and throw that in the SpriteManager's array.

            cursor = new SECursor(camera, this);

            //GuiManager.Initialize(camera, "genGfx/defaultText.tga", this, cursor);
            GuiManager.Cursors[0] = cursor;

            FlatRedBallServices.Update(null);

            SpriteEditorSettings.Initialize();
            SpriteManager.MaxParticleCount = 10000;
            GameData.Initialize();
            GuiData.Initialize();
            GuiData.messages.Initialize(this);
        }
예제 #2
0
파일: Game1.cs 프로젝트: ericrvass/livepong
        protected override void Update(GameTime gameTime)
        {
            FlatRedBallServices.Update(gameTime);

            if (gameBall.sprite != null)
            {
                ScoreStateManage();

                UpdateInput();

                UpdateWiimotes();

                CheckCollisions();

                if (showPositions)
                {
                    player1.updatePositionText();
                    player2.updatePositionText();
                    gameBall.updatePositionText();
                }
            }
            else
            {
                WinStateManage();
                GameStartStateManage();
            }
            FlatRedBall.Screens.ScreenManager.Activity();


            base.Update(gameTime);
        }
예제 #3
0
        public GameForm() : base()
        {
            //set the window caption.  This should be the name of your game with version number.
            //Edit your assembly info to alter your version number of your game
            this.Text = "ParticleEditor - Editing unsaved .emix";

            camera = SpriteManager.Cameras[0];

            cursor = GuiManager.Cursor;

            FlatRedBallServices.Update();


            gameData = new EditorData();

            gameData.Initialize(this);


            EditorData.guiData.Initialize();



            GuiData.Messages.Initialize(this);

            GuiManager.RefreshTextSize();
        }
예제 #4
0
        protected override void Update(GameTime gameTime)
        {
#if UNIT_TESTS
            ((Form)Form.FromHandle(Window.Handle)).WindowState = FormWindowState.Minimized;
#endif
            FlatRedBallServices.Update(gameTime);

            CustomActivity();

            FlatRedBall.Screens.ScreenManager.Activity();

            string debugText = "";

            if (FlatRedBall.Screens.ScreenManager.CurrentScreen != null)
            {
                debugText = FlatRedBall.Screens.ScreenManager.CurrentScreen + " " +
                            FlatRedBall.Screens.ScreenManager.CurrentScreen.PauseAdjustedSecondsSince(0).ToString("0.00");
            }

            if (GlobalContent.IsInitialized == false)
            {
                debugText += "\nGlobal Content still initializing...";
            }
            else
            {
                debugText += "\nGlobal Content done initializing";
            }

            FlatRedBall.Debugging.Debugger.TextCorner = FlatRedBall.Debugging.Debugger.Corner.BottomRight;
            FlatRedBall.Debugging.Debugger.Write(debugText);

            base.Update(gameTime);
        }
예제 #5
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)
        {
            FlatRedBallServices.Update(gameTime);

            EditorData.Update();

            base.Update(gameTime);
        }
예제 #6
0
        protected override void Update(GameTime gameTime)
        {
            FlatRedBallServices.Update(gameTime);

            FlatRedBall.Screens.ScreenManager.Activity();

            base.Update(gameTime);
        }
예제 #7
0
        protected override void Update(GameTime gameTime)
        {
            FlatRedBallServices.Update(gameTime);
            GluxManager.Update();
            HighlightManager.Self.Activity();
            EditingManager.Self.Activity();

            base.Update(gameTime);
        }
예제 #8
0
        void GameForm_Activated(object sender, EventArgs e)
        {
            FlatRedBallServices.Update(null);

            if (FlatRedBallServices.IsInitialized)
            {
                GuiManager.Cursor.ResetCursor();
            }
        }
예제 #9
0
        protected override void Update(GameTime gameTime)
        {
            // Update FRB.
            FlatRedBallServices.Update(gameTime);

            FlatRedBall.Screens.ScreenManager.Activity();

            // This needs to be called. Do not remove it.
            base.Update(gameTime);
        }
예제 #10
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)
        {
            FlatRedBallServices.Update(gameTime);
            // I don't think GView needs a ScreenManager activity does it?
            //Screens.ScreenManager.Activity();
            EditorLogic.Activity();

            GluxManager.Update();
            base.Update(gameTime);
        }
예제 #11
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)
        {
            FlatRedBallServices.Update(gameTime);
            ScreenManager.Activity();

            EditorLogic.Activity();

            // TODO: Add your update logic here
            GluxManager.Update();
            base.Update(gameTime);
        }
예제 #12
0
        protected override void Update(GameTime gameTime)
        {
            // Update FRB.
            FlatRedBallServices.Update(gameTime);

            // This needs to be called. Do not remove it.
            base.Update(gameTime);

            _redBallSprite.X = FlatRedBall.Gui.GuiManager.Cursor.WorldXAt(0);
            _redBallSprite.Y = FlatRedBall.Gui.GuiManager.Cursor.WorldYAt(0);
        }
예제 #13
0
        protected override void Update(GameTime gameTime)
        {
            FlatRedBallServices.Update(gameTime);

            FlatRedBall.Screens.ScreenManager.Activity();

            if (InputManager.Keyboard.KeyDown(Keys.Escape))
            {
                FlatRedBallServices.Game.Exit();
            }

            base.Update(gameTime);
        }
예제 #14
0
        /// <summary>
        /// Updates the game each cycle
        /// </summary>
        /// <param name="gameTime">Container for information about time elapsed since last update.</param>
        protected override void Update(GameTime gameTime)
        {
            FlatRedBallServices.Update(gameTime);
            FlatRedBall.Screens.ScreenManager.Activity();

            if (previewEmitter != null)
            {
                previewEmitter.TimedEmit(particles);
                FlatRedBall.Debugging.Debugger.CommandLineWrite("Particles: " + particles.Count);
            }

            base.Update(gameTime);
        }
예제 #15
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)
        {
            Form myForm = (Form)Form.FromHandle(this.Window.Handle);

            if (myForm.Focused)
            {
                FlatRedBallServices.Update(gameTime);

                EditorData.Update();
            }

            base.Update(gameTime);
        }
예제 #16
0
        protected override void Update(GameTime gameTime)
        {
            FlatRedBallServices.Update(gameTime);

            //for (var i = 0; i < 10; i++)
            //{
            //    GeneticsManager.PerformTest(i);
            //}

            FlatRedBall.Screens.ScreenManager.Activity();

            base.Update(gameTime);
        }
예제 #17
0
        protected override void Update(GameTime gameTime) //Runs once every frame
        {
            FlatRedBallServices.Update(gameTime);         //does flatredball stuff


            foreach (GameObject g in new List <GameObject>(gameObjects)) //Runs the update method in all
            {
                g.Update(gameObjects);
            }

            FlatRedBall.Screens.ScreenManager.Activity(); //Again, flatredball stuff

            base.Update(gameTime);
        }
예제 #18
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)
        {
            FlatRedBallServices.Update(gameTime);
            //Screens.ScreenManager.Activity();
            EditorData.Update();
            if (EditorData.Scene != null)
            {
                foreach (SpriteGrid spriteGrid in EditorData.Scene.SpriteGrids)
                {
                    spriteGrid.Manage();
                }
            }
            // TODO: Add your update logic here

            base.Update(gameTime);
        }
예제 #19
0
        protected override void Update(GameTime gameTime)
        {
            FlatRedBallServices.Update(gameTime);

            FlatRedBall.Screens.ScreenManager.Activity();

            if (InputManager.Keyboard.KeyReleased(Keys.V))
            {
                cap             = !cap;
                IsFixedTimeStep = cap;
                graphics.SynchronizeWithVerticalRetrace = cap;
                graphics.ApplyChanges();
            }

            base.Update(gameTime);
        }
예제 #20
0
        public void TestEvents()
        {
            IWindowImplementation iwi = new IWindowImplementation();

            GuiManager.AddWindow(iwi);
            GuiManager.Cursor.UsingMouse = false;

            Microsoft.Xna.Framework.GameTime gameTime = new Microsoft.Xna.Framework.GameTime(
                new TimeSpan(0, 0, 0, 0, 1), new TimeSpan(0, 0, 0, 0, 1));

            FlatRedBallServices.Update(gameTime);

            if (GuiManager.Cursor.WindowOver != iwi)
            {
                throw new Exception("The cursor should be over the window");
            }
        }
예제 #21
0
파일: Game.cs 프로젝트: MaciejSzpakowski/mu
        protected override void Update(GameTime gameTime)
        {
            FlatRedBallServices.Update(gameTime);
            Globals.GameTime = gameTime;
            Globals.EventManager.PreActivity();
            ScreenManager.Activity();
            Globals.EventManager.PostActivity();
            if (Debug.DebugMode)
            {
                if (Keyboard.KeyDown(Keys.LeftControl) &&
                    Keyboard.KeyPushed(Keys.H))
                {
                    Debug.Console.Visible    = !Debug.Console.Visible;
                    Debug.PrintDebug.Visible = !Debug.PrintDebug.Visible;
                }
                Debug.PrintDebug.PrintDebugString();
                Debug.DequeueNewMessages();
            }

            base.Update(gameTime);
        }
예제 #22
0
        protected override void Update(GameTime gameTime)
        {
            try
            {
                FlatRedBallServices.Update(gameTime);


                EditorData.Update();

                if (EditorData.Scene != null)
                {
                    foreach (SpriteGrid spriteGrid in EditorData.Scene.SpriteGrids)
                    {
                        spriteGrid.Manage();
                    }
                }

                base.Update(gameTime);
            }
            catch (Exception e)
            {
                System.Windows.Forms.MessageBox.Show(e.ToString());
            }
        }
예제 #23
0
 public override void Update(GameTime gameTime)
 {
     global::RenderingLibrary.SystemManagers.Default.Activity(gameTime.ElapsedGameTime.TotalSeconds);
     FlatRedBallServices.Update(gameTime);
 }
예제 #24
0
 protected virtual void Update(GameTime gameTime)
 {
     // Update FRB
     FlatRedBallServices.Update(gameTime);
 }
예제 #25
0
 public virtual void FrameUpdate()
 {
     FlatRedBallServices.Update();
 }
예제 #26
0
        /// <summary>
        /// Updates state manager and the states inside.
        /// </summary>
        /// <param name="time">Amount of time passed between calls.</param>
        protected override void Update(GameTime time)
        {
            //Updates the engines
            FlatRedBallServices.Update(time);
            Global.SoundManager.Update(time);
            Global.GUIManager.Update(time);
            Global.Logger.SetTime(time.TotalGameTime.ToString());

            //Updates state
            #region Process state list
            //Trim states
            for (int i = 0; i < m_Depth; i++)
            {
                RemoveState();
            }
            m_Depth = 0;

            //Is list empty?
            bool Empty = m_StateList.Count <= 0;

            //Does last state exist and not null?
            bool TopExist = false;
            if (!Empty)
            {
                TopExist = (m_StateList.Last.Value != null);
            }

            //No active state found
            bool ActiveFound = false;

            //While not empty, last state exist, and active state has not been found
            while (!Empty && TopExist && !ActiveFound)
            {
                //Remove last state if not active
                if (!m_StateList.Last.Value.IsActive())
                {
                    RemoveState();
                }
                //Otherwise, found active state
                else
                {
                    ActiveFound = true;
                }

                //Check if state is now empty
                Empty    = m_StateList.Count <= 0;
                TopExist = Empty ? false : (m_StateList.Last != null);
            }

            //Quit if list is empty or last state doesn't exist
            if (Empty || !TopExist)
            {
                Exit();
            }
            else
            {
                m_StateList.Last.Value.Update(time);
            }
            #endregion

            //Updates the original class);
            base.Update(time);
        }