Example #1
0
        public override ScreenType Run(Time dt)
        {
            NextScreen = base.Run(dt);

            NextScreen = ScreenType.LoginScreen;

            return NextScreen;
        }
Example #2
0
        public override ScreenType Run(Time dt)
        {
            UpdateView(dt);

            Map.Update(dt);
            Map.Draw(Window);

            return base.Run(dt);
        }
Example #3
0
        public override ScreenType Run(Time dt)
        {
            NextScreen = base.Run(dt);

              //  NextScreen = ScreenType.MainTitleScreen;
              //  GameSession.Instance.Init(true);

            return NextScreen;
        }
Example #4
0
 public void Update(Time dt)
 {
     Dt += dt.Value;
     if (Dt > Period)
     {
         Dt -= Period;
         Action.Invoke();
     }
 }
Example #5
0
        public override void Update(Time dt)
        {
            base.Update(dt);

            Combat.Update(dt);
        }
Example #6
0
        public override void Update(Time dt)
        {
            base.Update(dt);

            if (Map == null || !GetMapIsUpdated())
                return;

            Map.Update(dt);

            GameRoot.MoveGameView(ViewMove);

            ViewMove = new Vector2f();

            Inputs.Instance.UpdateState();
        }
Example #7
0
        public Boolean Update(Time dt)
        {
            // FPS.Update(dt);

            Inputs.Instance.UpdateState();

            Window.DispatchEvents();
            Window.Clear();

            Screens.Current = Screens.GetCurrent().Run(dt);

            Window.Display();

            IsRunning = Window.IsOpened();
            return IsRunning;
        }
Example #8
0
        public override void Update(Time dt)
        {
            base.Update(dt);

            if (MenuItems.Count == 0)
            {
                ShowCursor(false);
                return;
            }

            if (Alignment == Alignment.Vertical)
            {
                Cursor.Dimension += new Vector2f(
                    (GetCurrentItem().BackgroundDimension.X - Cursor.BackgroundDimension.X) / CURSOR_VELOCITY * (float)dt.MS,
                    (GetCurrentItem().BackgroundDimension.Y - Cursor.BackgroundDimension.Y) / CURSOR_VELOCITY * (float)dt.MS);

                Cursor.Center += new Vector2f(
                    GetCurrentItem().Center.X - Cursor.Center.X,
                    (GetCurrentItem().Center.Y - Cursor.Center.Y) / CURSOR_VELOCITY * (float)dt.MS);
            }
            else
            {
                Cursor.Dimension += new Vector2f(
                    (GetCurrentItem().BackgroundDimension.X - Cursor.BackgroundDimension.X) / CURSOR_VELOCITY * (float)dt.MS,
                    (GetCurrentItem().BackgroundDimension.Y - Cursor.BackgroundDimension.Y) / CURSOR_VELOCITY * (float)dt.MS);

                Cursor.Center += new Vector2f(
                    (GetCurrentItem().Center.X - Cursor.Center.X) / CURSOR_VELOCITY * (float)dt.MS,
                    GetCurrentItem().Center.Y - Cursor.Center.Y);
            }

            if (!IsEnabled)
                return;

            if (Alignment == BlazeraLib.Alignment.Vertical)
            {
                if (Inputs.IsGameInput(DEFAULT_VERTICAL_MENU_DOWN_INPUT_TYPE, SWITCHING_RELASED_MODE, SWITCHING_DEFAULT_DELAY, true, true))
                {
                    Down();
                }

                if (Inputs.IsGameInput(DEFAULT_VERTICAL_MENU_UP_INPUT_TYPE, SWITCHING_RELASED_MODE, SWITCHING_DEFAULT_DELAY, true, true))
                {
                    Up();
                }
            }
            else
            {
                if (Inputs.IsGameInput(DEFAULT_HORIZONTAL_MENU_RIGHT_INPUT_TYPE, SWITCHING_RELASED_MODE, SWITCHING_DEFAULT_DELAY, true, true))
                {
                    Down();
                }

                if (Inputs.IsGameInput(DEFAULT_HORIZONTAL_MENU_LEFT_INPUT_TYPE, SWITCHING_RELASED_MODE, SWITCHING_DEFAULT_DELAY, true, true))
                {
                    Up();
                }
            }
        }
Example #9
0
        public override void Update(Time dt)
        {
            BackHappened = false;

            base.Update(dt);
        }
Example #10
0
 public override void Update(Time dt)
 {
     Effect.Update(dt);
 }
Example #11
0
        public override void Update(Time dt)
        {
            base.Update(dt);

            if (ValueIsModified)
            {
                AdjustValue();
                ValueIsModified = false;
            }
        }
Example #12
0
 public override void Update(Time dt)
 {
     if (CurrentSkin != null)
         CurrentSkin.Update(dt);
 }
Example #13
0
            public void Update(Time dt)
            {
                if (PointIsReached)
                {
                    if (!InitNextMove() &&
                        !InitNextPoint())
                    {
                        if (Combatant.IsMoving())
                            Combatant.CallOnMoveEnding();

                        Combatant.State = CombatantState.Normal;
                        return;
                    }
                }

                Vector2f move = BlazeraLib.Map.GetMove(CurrentDirection, DEFAULT_VELOCITY, dt);

                switch (CurrentDirection)
                {
                    case Direction.N:

                        if (Combatant.GetBasePosition().Y + move.Y > CurrentGoalPoint.Y)
                        {
                            Combatant.Position += move;
                            return;
                        }

                        break;

                    case Direction.E:

                        if (Combatant.GetBasePosition().X + move.X < CurrentGoalPoint.X)
                        {
                            Combatant.Position += move;
                            return;
                        }

                        break;

                    case Direction.S:

                        if (Combatant.GetBasePosition().Y + move.Y < CurrentGoalPoint.Y)
                        {
                            Combatant.Position += move;
                            return;
                        }

                        break;

                    case Direction.O:

                        if (Combatant.GetBasePosition().X + move.X > CurrentGoalPoint.X)
                        {
                            Combatant.Position += move;
                            return;
                        }

                        break;
                }

                Combatant.SetBasePoint(CurrentGoalPoint);
                PointIsReached = true;
                Combatant.CellPosition = CurrentGoal;
            }
Example #14
0
        public void Update(Time dt)
        {
            MoveInfo.Update(dt);

            GetCurrentAnimation().Update(dt);
        }
Example #15
0
File: Cell.cs Project: jpx/blazera
 public void Update(Time dt)
 {
 }
Example #16
0
        Vector2f GetViewMove(Time dt, Player player)
        {
            float moveX = 0.0f;
            float moveY = 0.0f;

            if (player == null)
            {
                return new Vector2f(moveX, moveY);
            }

            Vector2f p = player.Center;

            if (Math.Abs(p.X - GameRoot.MapView.Center.X) > VIEW_MOVE_TRIGGER_LIMIT * (GameData.WINDOW_HEIGHT / GameData.WINDOW_WIDTH))
                moveX = player.Velocity * (p.X - GameRoot.MapView.Center.X) / 50f * GameData.WINDOW_WIDTH / GameData.WINDOW_HEIGHT * (float)dt.Value;
            if (Math.Abs(p.Y - GameRoot.MapView.Center.Y) > VIEW_MOVE_TRIGGER_LIMIT * (GameData.WINDOW_WIDTH / GameData.WINDOW_HEIGHT))
                moveY = player.Velocity * (p.Y - GameRoot.MapView.Center.Y) / 50f * GameData.WINDOW_HEIGHT / GameData.WINDOW_WIDTH * (float)dt.Value;

            /*if (Math.Abs(moveX) < VIEW_MOVE_MINOR_LIMIT)
                moveX = p.X - Gui.MapView.Center.X;

            if (Math.Abs(moveY) < VIEW_MOVE_MINOR_LIMIT)
                moveY = p.Y - Gui.MapView.Center.Y;*/

            if (GameRoot.MapView.Center.X - GameRoot.MapView.Size.X / 2 + moveX < 0F)
            {
                GameRoot.MapView.Center = new Vector2f(0F, GameRoot.MapView.Center.Y) + new Vector2f(GameRoot.MapView.Size.X / 2F, 0F);
                moveX = 0.0f;
            }

            if (GameRoot.MapView.Center.X - GameRoot.MapView.Size.X / 2 + GameRoot.MapView.Size.X + moveX >= Map.Dimension.X)
            {
                GameRoot.MapView.Center = new Vector2f(Map.Dimension.X, GameRoot.MapView.Center.Y) - new Vector2f(GameRoot.MapView.Size.X / 2F, 0F);
                moveX = 0.0f;
            }

            if (GameRoot.MapView.Center.Y - GameRoot.MapView.Size.Y / 2 + moveY < 0F)
            {
                GameRoot.MapView.Center = new Vector2f(GameRoot.MapView.Center.X, 0F) + new Vector2f(0F, GameRoot.MapView.Size.Y / 2F);
                moveY = 0.0f;
            }

            if (GameRoot.MapView.Center.Y - GameRoot.MapView.Size.Y / 2 + GameRoot.MapView.Size.Y + moveY >= Map.Dimension.Y)
            {
                GameRoot.MapView.Center = new Vector2f(GameRoot.MapView.Center.X, Map.Dimension.Y) - new Vector2f(0F, GameRoot.MapView.Size.Y / 2F); ;
                moveY = 0.0f;
            }

            return new Vector2f(moveX, moveY);
        }
Example #17
0
 public void UpdateLockedViewMove(Time dt, Player player)
 {
     ViewMove = GetViewMove(dt, player);
 }
Example #18
0
 public override void Update(Time dt)
 {
     foreach (SMap map in Maps.Values)
         map.Update(dt);
 }
Example #19
0
        public override ScreenType Run(Time dt)
        {
            foreach (ParticleEffect pe in effects)
            {
                pe.Update(dt);
                pe.Draw(Window);
            }

               // Window.Draw(spre);

            NextScreen = base.Run(dt);

               // NextScreen = ScreenType.GameScreen;

            return NextScreen;
        }
Example #20
0
        public override void Update(Time dt)
        {
            base.Update(dt);

            Cursor.Center += new Vector2f(
                (((CellPosition.ToVector2() + new Vector2f(.5F, 0F)) * (int)CombatMap.CELL_SIZE).X - Cursor.Center.X) / TRANSITION_VELOCITY * (float)dt.MS,
                (((CellPosition.ToVector2() + new Vector2f(0F, .5F)) * (int)CombatMap.CELL_SIZE).Y - Cursor.Center.Y) / TRANSITION_VELOCITY * (float)dt.MS);

            if (!IsEnabled)
                return;

            FastCursorMode = Inputs.IsGameInput(InputType.Misc, false);
            double cursorMoveDelay = FastCursorMode ? FAST_CURSOR_MOVE_DELAY : CRUSOR_MOVE_DELAY;

            if (Inputs.IsGameInput(InputType.Left, false, cursorMoveDelay))
                Move(new Vector2I(-MOVE_CELL_OFFSET, 0));
            else if (Inputs.IsGameInput(InputType.Up, false, cursorMoveDelay))
                Move(new Vector2I(0, -MOVE_CELL_OFFSET));
            else if (Inputs.IsGameInput(InputType.Right, false, cursorMoveDelay))
                Move(new Vector2I(MOVE_CELL_OFFSET, 0));
            else if (Inputs.IsGameInput(InputType.Down, false, cursorMoveDelay))
                Move(new Vector2I(0, MOVE_CELL_OFFSET));
        }
Example #21
0
        public void Update(Time dt)
        {
            foreach (BaseCombatant combatant in Combatants)
                combatant.Update(dt);

            GetCurrentPhase().Perform();
        }
Example #22
0
        /// <summary>
        /// Updates the object
        /// </summary>
        /// <param name="dt">Delay since last update</param>
        public override void Update(Time dt)
        {
            base.Update(dt);

            if (!IsPlaying)
                return;

            double letterDelay = Inputs.IsGameInput(InputType.Action) ? LETTER_DELAY / LETTER_DELAY_SPEED_FACTOR : LETTER_DELAY;
            UInt32 delayCount = LetterTimer.GetDelayFactor(letterDelay);
            for (UInt32 count = 0; count < delayCount; ++count)
                NextLetter();
        }
Example #23
0
        public override void Update(Time dt)
        {
            if (!IsStarted)
                return;

            bool moveIsComplete = Math.Abs(Offset.X) >= OffsetLimit.X && Math.Abs(Offset.Y) >= OffsetLimit.Y;
            bool scaleIsComplete = Math.Abs(Scale.X) >= ScaleLimit.X && Math.Abs(Scale.Y) >= ScaleLimit.Y;
            bool alphaIsComplete = Math.Abs(Alpha) >= AlphaLimit;

            if (moveIsComplete && scaleIsComplete && alphaIsComplete)
            {
                Stop();
                return;
            }

            Skin.Update(dt);

            if (!moveIsComplete)
            {
                Offset += MoveFactor * (float)dt.Value;
                Skin.Position = Position + Offset;
            }
            if (!scaleIsComplete)
            {
                Scale += ScaleFactor * (float)dt.Value;
                Skin.Dimension = BaseSkin.Dimension + new Vector2f(BaseSkin.Dimension.X * Scale.X, BaseSkin.Dimension.Y * Scale.Y);
                Skin.BasePoint = Skin.Center;
            }
            if (!alphaIsComplete)
            {
                Alpha += AlphaFactor * (float)dt.Value;
                Skin.SetAlpha(BaseSkin.Color.A + Alpha);
            }
        }
Example #24
0
 public virtual void Update(Time dt)
 {
 }
Example #25
0
        public void Run(Time dt)
        {
            Window.SetView(GuiView);

            Gui.Update(dt);
            Gui.Draw(Window);

            while (WindowEvents.EventHappened())
            {
                BlzEvent evt = new BlzEvent(WindowEvents.GetEvent());

                GameScoring.EventCount++;

                if (HandleEvent(evt))
                {
                    GameScoring.EventHandled++;
                }
            }
        }
Example #26
0
        public override void Update(Time dt)
        {
            base.Update(dt);

            if (!CursorMode)
                return;

            if (Current == null)
                return;

            Cursor.Dimension += new Vector2f(
                (Current.Dimension.X - Cursor.Dimension.X) / CURSOR_VELOCITY * (float)dt.MS,
                (Current.Dimension.Y - Cursor.Dimension.Y) / CURSOR_VELOCITY * (float)dt.MS);

            Cursor.Position += new Vector2f(
                Current.Position.X - Cursor.Position.X,
                (Current.Center.Y - Cursor.Center.Y) / CURSOR_VELOCITY * (float)dt.MS);
        }
Example #27
0
        public override void Update(Time dt)
        {
            if (!IsPlaying)
                return;

            double period = 1D / FrameRate;

            if (!Timer.IsDelayCompleted(period))
                return;

            NextFrame();
        }
Example #28
0
        public override void Update(Time dt)
        {
            base.Update(dt);

            Cursor.Center = GetLockedPosition(((EditorBaseWidget)Root).GetMousePosition());
        }
Example #29
0
        public override void Update(Time dt)
        {
            base.Update(dt);

            if (CurrentMap == null)
                return;

            CurrentMap.Update(dt);
        }
Example #30
0
 public abstract void Update(Time dt);