Ejemplo n.º 1
0
        // if top player wins, displays certain text & fades some drawables& adds endgame actions
        public void OppAWinner()
        {
            speedState = gameState.Winner;
            Text winner = new Text("Winner!!!", _font)
            {
                attributes = new Attributes()
                {
                    color    = Color.Red,
                    position = new Vector2(512, 180),
                    //rotation = -.2f,
                    depth = .1f
                },
                scale = new Vector2(.8f, .8f)
            };
            Text loser = new Text("Scrub!!!", _font)
            {
                attributes = new Attributes()
                {
                    color    = Color.DarkBlue,
                    position = new Vector2(512, 650),
                    //rotation = -.2f,
                    depth = .1f
                },
                scale = new Vector2(.8f, .8f)
            };

            yourSelector.Fade(2);
            oppSelector.Fade(2);
            oppSelector.Move(Actions.ExpoMove, new Vector2(512, 400), 2);
            oppSelector.WhenDoneMoving(delegate()
            {
                base.Add(winner);
                base.Add(loser);
            });
            oppSelector.Scale(Actions.LinearMove, yourSelector.attributes.scale * 2, 2);
            Timer endGame = new Timer(2);

            base.Add(endGame);
            endGame.SetTimer(0, 6, delegate()
            {
                yourScore.attributes.color    = Color.LightSkyBlue;
                yourScore.isSeeable           = true;
                yourScore.attributes.position = new Vector2(624, 675);
                yourScore.height             = 150;
                oppScore.attributes.color    = Color.Red;
                oppScore.isSeeable           = true;
                oppScore.attributes.position = new Vector2(400, 675);
                oppScore.height = 150;
                Text dash       = new Text(" - ", _font);
                dash.attributes = new Attributes()
                {
                    color = Color.Black, position = new Vector2(512, 675)
                };
                dash.isSeeable = true;
                dash.height    = 150;
                base.Add(dash);
                if (myType == gameType.Levels)
                {
                    YouLost();
                }
                else
                {
                    Reset();
                }
            });
            endGame.SetTimer(1, 4, delegate() { winner.Fade(2); loser.Fade(2); });
        }