Пример #1
0
        // card constructor
        public Card(int card, Texture2D front, Texture2D back, Vector2 position, bool faceUp)
        {
            // initializing variables
            cardNumber = card;
            cardValue = cardNumber % 13;
            cardFront = front;
            cardBack = back;

            // giving cards their attributes
            attributes = new Attributes()
               {
                    position = position,
                    rotation = 0,
                    color = Color.White,
               };

            isFaceUp = faceUp;                // sets cards faceUp
            attributes.height = cardHeight;   // gives cards height of 180 (instance variable)
            attributes.width = cardWidth;     // gives cards width of 130 (instance variable)
            isFlipping = false;               //cards are not flipping
        }
Пример #2
0
 // constructor -- gives attributes what it has and sets drawable to isSeeable
 public Drawable()
 {
     attributes = new Attributes();
     isSeeable = true;
 }