Exemple #1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        public void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            screenSize = new Point(graphics.GraphicsDevice.DisplayMode.Width, graphics.GraphicsDevice.DisplayMode.Height);
            DebugGUI.init(graphics.GraphicsDevice);
            ScaleManager.setDefaultValues(screenSize);
            Card.setDefaultScale(ScaleManager.CardScale);

            button = this.Content.Load <Texture2D>("button.9.png");

            Card.setTexture(this.Content.Load <Texture2D>("cards.png"));
            DebugCards.init();

            font11pt = this.Content.Load <SpriteFont>("mgcb\\V5Extender11");
            font22pt = this.Content.Load <SpriteFont>("mgcb\\V5Extender22");
            font33pt = this.Content.Load <SpriteFont>("mgcb\\V5Extender33");
            font44pt = this.Content.Load <SpriteFont>("mgcb\\V5Extender44");
            font55pt = this.Content.Load <SpriteFont>("mgcb\\V5Extender55");

            frameController = new FrameController();

            frameHand = new FrameHand(Vector2.Zero);
            frameController.addFrame(frameHand, VectorDirection.Down, true);

            CardContainer container = frameHand.addContainer();

            for (int i = 0; i < 20; i++)
            {
                container.addCard(DebugCards.draw());
            }
            CardSnap snap = new CardSnap(new Vector2(0, screenSize.Y), (float)screenSize.X, false);

            frameHand.addSnap(container, snap);
        }
Exemple #2
0
        public override void update(GameTime gameTime)
        {
            base.update(gameTime);
            FrameController controller = GameClient.Instance.frameController;

            foreach (GestureSample gesture in GestureManager.Gestures)
            {
                if (gesture.GestureType == GestureType.Tap)
                {
                    if (scoreTab.checkForHit(gesture.Position))
                    {
                        if (IsActive)
                        {
                            controller.stow(this);
                            Console.WriteLine("STOWED");
                        }
                        else
                        {
                            controller.activate(this);
                            Console.WriteLine("ACTIVATED");
                        }
                    }
                }
            }
            foreach (Player player in ClientDataStore.Instance.Players)
            {
                NineGridRow row = scoreboard.getRow(player.ID.ToString());
                row.getCell("score").Text  = player.Score.ToString();
                row.getCell("bid").Text    = (player.Bid == -1 ? "-" : player.Bid.ToString());
                row.getCell("tricks").Text = player.TricksWon.ToString();
            }
        }
Exemple #3
0
        public GameClient()
        {
            DebugCards.init();

            frameController = new FrameController();

            frameTable      = new FrameTable(Vector2.Zero);
            frameHand       = new FrameHand(Vector2.Zero);
            frameBid        = new FrameBid(Vector2.Zero);
            frameScoreboard = new FrameScoreboard(Vector2.Zero);
            playerIndicator = new PlayerIndicator(Vector2.Zero);
            frameEndgame    = new FrameEndgame(Vector2.Zero);
            frameController.addFrame(frameHand, Arranger.staticPoint(0f, 1f), true);
            frameController.addFrame(frameTable, Arranger.staticPoint(0f, -1f), false);
            frameController.addFrame(frameBid, Arranger.staticPoint(1f, 0f), false);
            frameController.addFrame(frameScoreboard, Vector2.Zero, false);
            frameController.addFrame(playerIndicator, Arranger.staticPoint(-1f, 0f), false);
            frameController.addFrame(frameEndgame, Arranger.staticPoint(0f, 0f), false);

            parallax = new ParallaxBackground(Vector2.Zero);
            frameHand.injectParallax(parallax);

            playerHand = frameHand.hand;
        }