Пример #1
0
        //ButtonUI resourceButton;
        public CardSelectedOverlay(
            GameInstance game,
            Card card,
            Vector2 originCardPosition,
            Vector2 goalCardPosition,
            float originCardRotation = 0.0f, 
            float goalCardRotation = 0.0f)
            : base(game)
        {
            this.card = card;
            this.flyInAnimation = new CardAnimation(card,
                                                    originCardPosition,
                                                    goalCardPosition,
                                                    10,
                                                    1.0f,
                                                    5.0f,
                                                    originCardRotation,
                                                    goalCardRotation,
                                                    false);
            this.flyOutAnimation = new CardAnimation(card,
                                                    goalCardPosition,
                                                    originCardPosition,
                                                    10,
                                                    5.0f,
                                                    1.0f,
                                                    goalCardRotation,
                                                    originCardRotation,
                                                    true);
            this.goalCardPosition = goalCardPosition;
            this.viewPort = new Rectangle(game.GraphicsDevice.PresentationParameters.Bounds.Width / 2, game.GraphicsDevice.PresentationParameters.Bounds.Height/2, game.GraphicsDevice.PresentationParameters.Bounds.Width, game.GraphicsDevice.PresentationParameters.Bounds.Height);

            this.playButton = new ButtonUI(game, new Rectangle(550, 420, 300, 100), 1, "Play!");
            //this.resourceButton = new ButtonUI(game, new Rectangle(400, 400, 205, 50), 3, "Resource");
        }
Пример #2
0
 public CardAnimation(
     Card card,
     Vector2 originPosition,
     Vector2 goalPosition,
     uint totalFrame,
     float originScale = 1.0f,
     float goalScale = 1.0f,
     float originRotation = 0.0f,
     float goalRotation = 0.0f,
     bool rotateClockwise = true,
     Color? frameColor = null,
     string animationFinishedSFXKey = null
     )
     : base(originPosition, goalPosition, totalFrame, originScale, goalScale, originRotation, goalRotation, rotateClockwise, animationFinishedSFXKey)
 {
     this.card = card;
     this.frameColor = frameColor;
 }
Пример #3
0
        public void PlayCard(Card card)
        {
            this.ActionPoint--;

            this.Hand.Remove(card);
            this.game.PlayZone.CardList.Add(card);

            // Resolve
            this.ActionPoint += card.ActionPoint;
            this.ResourcePoint += card.ResourcePoint;
            this.AttackPoint += card.AttackPoint;
        }
Пример #4
0
        private void DrawInfoBox(SpriteBatch spriteBatch, Card card)
        {
            // Draw box
            Vector2 boxPos = this.getHandCardPosition(mouse_hover_index);
            spriteBatch.Draw(
                GameInstance.squareTexture,
                new Rectangle((int)boxPos.X - 75, (int)boxPos.Y, 50, 50),
                null,
                Color.OrangeRed);

            spriteBatch.Draw(
                GameInstance.squareTexture,
                new Rectangle((int)boxPos.X - 72, (int)boxPos.Y + 3, 44, 44),
                null,
                Color.LightGoldenrodYellow);

            // Draw Stats
            Vector2 textPos = new Vector2(boxPos.X - 72, boxPos.Y + 2);
            GameInstance.DrawText(
                spriteBatch,
                card.ActionPoint.ToString(),
                textPos,
                Color.Green,
                null,
                null,
                0.0f,
                0.7f);

            textPos.Y += 13;
            GameInstance.DrawText(
                spriteBatch,
                card.ResourcePoint.ToString(),
                textPos,
                Color.Orange,
                null,
                null,
                0.0f,
                0.7f);

            textPos.Y += 13;
            GameInstance.DrawText(
                spriteBatch,
                card.AttackPoint.ToString(),
                textPos,
                Color.DarkMagenta,
                null,
                null,
                0.0f,
                0.7f);
        }