Example #1
0
        public void Execute()
        {
            var MyScene = (Scene)Global.CurrentScene;

            if (MyScene.GetType().Name != "CardScene")
            {
                return;
            }

            var entities = Context <Default> .AllOf <GameStatComponent>().GetEntities();

            foreach (var entity in entities)
            {
                GameStatComponent sc = entity.Get <GameStatComponent>();
                Text txt             = entity.Get <Text>();
                txt.Content = sc.ScoreWords + sc.Score.ToString();

                //if (Raylib.IsMouseButtonPressed(MouseButton.MOUSE_LEFT_BUTTON))
                if (Global.StateOfGame == GameState.Over)
                {
                    MsgBox msb = entity.Get <MsgBox>();
                    msb.RenderLayer = 10000;
                    Label lbl = new Label(new Vector2(15, 5), "Press Play to continue the game.");
                    //lbl.TextData.FontSize = 25;
                    msb.AddMsg(lbl);
                    msb.AddMsg(new Label(new Vector2(15, 30), "Score : " + sc.Score.ToString("###")));
                    //msb.AddButton(new Button(new Vector2(14, 50), 50, 25, "OK"));
                    msb.Visiable = true;
                }
            }
        }
Example #2
0
        public void UpdateScore(int _value)
        {
            /*
             *  Waste to Tableau	5
             *  Waste to Foundation	10
             *  Tableau to Foundation	10
             *  Turn over Tableau card	5
             *  Foundation to Tableau	−15
             *  Recycle waste when playing by ones	−100 (minimum score is 0)
             */

            GameStatComponent sc = GameStatus.Get <GameStatComponent>();

            sc.Score += _value;
            if (sc.Score < 0)
            {
                sc.Score = 0;
            }
            possibleScoreValue = 0;
        }
Example #3
0
        public void PlayButton(object btn)
        {
            PlayBtn.Get <Transform>().Visiable = false;
            Global.StateOfGame = GameState.Playing;
            GameStatComponent sc = GameStatus.Get <GameStatComponent>();

            sc.Score = 0;
            MsgBox mb = GameStatus.Get <MsgBox>();

            mb.Visiable = false;

            //CardDeck.CreateDeckOfCards(false);

            //CreateDealPile();                           // deal stack (falce down)
            //CreateDrawPile();                           // face up dealt one card at a time
            //CreateEmptyAcePiles();                      // 4 of them
            //CreateEmptyPlayPiles();                     // 7 of them
            //CreateEmptyDragPile();                      // used to disp cards being dragged around
            //DealCardsToPiles();                         // draw cards & place in piles above
        }