Exemple #1
0
        public BosuReplayFrame(double time, float?positionx = null, float?positiony = null, BosuReplayFrame lastFrame = null, bool dash = false)
            : base(time)
        {
            PositionX = positionx ?? -100;
            PositionY = positiony ?? -100;
            Dashing   = dash;


            if (lastFrame != null)
            {
                if (PositionX > lastFrame.PositionX)
                {
                    lastFrame.Actions.Add(BosuAction.MoveRight);
                }
                else if (PositionX < lastFrame.PositionX)
                {
                    lastFrame.Actions.Add(BosuAction.MoveLeft);
                }

                if (PositionY < lastFrame.PositionY)
                {
                    lastFrame.Actions.Add(BosuAction.Jump);
                }
                else if (PositionY > lastFrame.PositionY)
                {
                    lastFrame.Actions.Add(BosuAction.MoveDown);
                }

                if (Dashing)
                {
                    lastFrame.Actions.Add(BosuAction.Dash);
                }
            }
        }
Exemple #2
0
        public BosuReplayFrame(double time, float?position = null, bool jumping = false, BosuReplayFrame lastFrame = null)
            : base(time)
        {
            Position = position ?? -100;
            Jumping  = jumping;

            if (Jumping)
            {
                Actions.Add(BosuAction.Jump);
            }

            if (lastFrame != null)
            {
                if (Position > lastFrame.Position)
                {
                    lastFrame.Actions.Add(BosuAction.MoveRight);
                }
                else if (Position < lastFrame.Position)
                {
                    lastFrame.Actions.Add(BosuAction.MoveLeft);
                }
            }
        }
        public BosuReplayFrame(double time, Vector2?position = null, bool jumping = false, bool shooting = false, BosuReplayFrame lastFrame = null)
            : base(time)
        {
            Position = position ?? new Vector2(-100, BosuPlayfield.BASE_SIZE.Y - IWannaExtensions.PLAYER_SIZE.Y / 2f - IWannaExtensions.TILE_SIZE);
            Jumping  = jumping;
            Shooting = shooting;

            if (Jumping)
            {
                Actions.Add(BosuAction.Jump);
            }

            if (Shooting)
            {
                Actions.Add(BosuAction.Shoot);
            }

            if (lastFrame != null)
            {
                if (Position.X > lastFrame.Position.X)
                {
                    lastFrame.Actions.Add(BosuAction.MoveRight);
                }
                else if (Position.X < lastFrame.Position.X)
                {
                    lastFrame.Actions.Add(BosuAction.MoveLeft);
                }
            }
        }