Esempio n. 1
0
        public void Grab(Balloon balloon)
        {
            balloon.AttachTo(this);
            this.DraggingBalloon = balloon;

            Assets.BalloonGrab.Play();
        }
Esempio n. 2
0
        public void EndGame(Player winner)
        {
            Manager.FadeInSong(Assets.WinSong, false, 0.8f);

            Actions.AddAction(new EndEquationInput(Input), true);

            foreach (DragableNumber num in Entities.Where(ent => ent.CollisionType == "number")) {
                Actions.AddAction(new TweenPositionTo(num, new Vector2(1300, -200), 1f, Linear.EaseIn), false);
            }

            for (int i = 0; i < 4; i++) {
                var hand = i < 2 ? winner.LeftHand : winner.RightHand;

                var balloon = new Balloon(100 * i, 0, 11);
                AddEntity(balloon);

                balloon.AttachTo(hand);
            }

            var posMenu = new Vector2(300, (MainGame.Height / 2) - 250);
            var menu = new MenuItem(Assets.SignMenu, -100, -300, delegate() { Manager.SwitchScreen(new MenuScreen(Context)); });
            menu.Actions.AddAction(new TweenPositionTo(menu, posMenu, 2f, Back.EaseOut), true);
            AddEntity(menu);

            var posRestart = new Vector2(MainGame.Width - 600, (MainGame.Height / 2) - 250);

            var restart = new MenuItem(Assets.MenuSignRestart, MainGame.Width + 100, -300, delegate() { Manager.SwitchScreen(new VersusPlayerScreen(Context)); });
            restart.Actions.AddAction(new TweenPositionTo(restart, posRestart, 2f, Back.EaseOut), true);
            AddEntity(restart);
        }
Esempio n. 3
0
        private void AttachWinnerBalloon(Player player)
        {
            for (int i = 0; i < 2; i++) {
                var hand = i < 1 ? player.LeftHand : player.RightHand;

                var balloon = new Balloon(100, 0, 11);
                AddEntity(balloon);

                balloon.AttachTo(hand);
            }
        }
Esempio n. 4
0
        private void AddRandomBalloons(EquationInput input)
        {
            var rand = new Random();
            var ball1 = new Balloon(input.X, input.Y, rand.Next(0, 11));
            var ball2 = new Balloon(input.X, input.Y, rand.Next(0, 11));

            AddEntity(ball1);
            AddEntity(ball2);

            ball1.AttachTo(Input.FirstEquationSlot);
            Input.FirstEquationSlot.Balloon = ball1;
            ball1.BalloonBody.CollidesWith = Category.None;

            ball2.AttachTo(Input.SecondEquationSlot);
            Input.SecondEquationSlot.Balloon = ball2;
            ball2.BalloonBody.CollidesWith = Category.None;
        }
Esempio n. 5
0
        private void AddBalloons(EquationInput input)
        {
            var rand = new Random();
            var ball1 = new Balloon((int)input.X, (int)input.Y, 5);
            var ball2 = new Balloon((int)input.X, (int)input.Y, 6);

            AddEntity(ball1);
            AddEntity(ball2);

            ball1.AttachTo(Input.FirstEquationSlot);
            Input.FirstEquationSlot.Balloon = ball1;

            ball2.AttachTo(Input.SecondEquationSlot);
            Input.SecondEquationSlot.Balloon = ball2;
        }
Esempio n. 6
0
        public bool TryAttach(Balloon balloon)
        {
            PlayerHand hand = (PlayerHand)balloon.AttachedEntity;

            if ((Reassignable || Balloon == null) && (Player == null || hand.Player == Player)) {
                if (Balloon != null) {
                    Balloon.Loose();
                }

                balloon.AttachTo(this);
                Balloon = balloon;

                Balloon.BalloonBody.CollidesWith = Category.None;

                hand.DraggingBalloon = null;

                Assets.BalloonDrop.Play();

                //MakeUncollidableUntilHandLeaves();

                return true;
            }

            return false;
        }
Esempio n. 7
0
        private void AddBalloonsSubtraction(EquationInput input)
        {
            var rand = new Random(); int Number1 = rand.Next(11, 100);
            int Number2 = rand.Next(10, Number1 - 1);
            var ball1 = new Balloon((int)input.X, (int)input.Y, GetIntArray(Number1)[0]);
            var ball2 = new Balloon((int)input.X, (int)input.Y, GetIntArray(Number2)[0]);
            var ball3 = new Balloon((int)input.X, (int)input.Y, GetIntArray(Number1)[1]);
            var ball4 = new Balloon((int)input.X, (int)input.Y, GetIntArray(Number2)[1]);

            AddEntity(ball1);
            AddEntity(ball2);
            AddEntity(ball3);
            AddEntity(ball4);

            ball1.AttachTo(Input.FirstEquationSlot);
            Input.FirstEquationSlot.Balloon = ball1;
            ball1.BalloonBody.CollidesWith = Category.None;

            ball2.AttachTo(Input.SecondEquationSlot);
            Input.SecondEquationSlot.Balloon = ball2;
            ball2.BalloonBody.CollidesWith = Category.None;

            ball3.AttachTo(Input.ThirdEquationSlot);
            Input.ThirdEquationSlot.Balloon = ball3;
            ball3.BalloonBody.CollidesWith = Category.None;

            ball4.AttachTo(Input.FourthEquationSlot);
            Input.FourthEquationSlot.Balloon = ball4;
            ball4.BalloonBody.CollidesWith = Category.None;
        }