Beispiel #1
0
        // if bottom player wins, displays certain text & fades some drawables& adds endgame actions
        public void YourAWinner()
        {
            speedState = gameState.Winner;

            Text winner = new Text("Winner!!!", _font)
            {
                attributes = new Attributes()
                {
                    color    = Color.LightSkyBlue,
                    position = new Vector2(512, 650),
                    //rotation = -.2f,
                    depth = .1f,
                },
                scale = new Vector2(.8f, .8f)
            };
            Text loser = new Text("Scrub!!!", _font)
            {
                attributes = new Attributes()
                {
                    color    = Color.DarkRed,
                    position = new Vector2(512, 180),
                    //rotation = -.2f,
                    depth = .1f
                },
                scale = new Vector2(.8f, .8f)
            };

            oppSelector.Fade(2);
            yourSelector.Move(Actions.ExpoMove, new Vector2(512, 400), 2);
            yourSelector.Fade(2);
            yourSelector.WhenDoneMoving(delegate()
            {
                base.Add(winner);
                base.Add(loser);
            });
            yourSelector.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(400, 675);
                yourScore.height             = 150;
                oppScore.attributes.color    = Color.Red;
                oppScore.isSeeable           = true;
                oppScore.attributes.position = new Vector2(624, 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)
                {
                    YouWon();
                }
                else
                {
                    Reset();
                }
            });
            endGame.SetTimer(1, 4, delegate() { winner.Fade(2); loser.Fade(2); });
        }