0 Favourites

[How should I?] Card Objects

  • Right now, I have 2Sprites (in-hand + in-play) with 54Slides each for all the cards.

    Should I do this or make each card an object? At the beginning, the deck is shuffled and PlayerA and PlayerB take turns making moves. Cards get played from in-hand to in-play and can also go in-play to in-hand. How should things get handled?

    timbanon.com/games/Dreamers.capx

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • If you plan on adding animations for each card and such, it's better to have each card be represented by a sprite. You can put all cards in one family.

    Then you can have events that affect all cards in the family or just certain cards (with specified private variables).

    You are going to need to define decks for each of players. Since there aren't that many cards, it's fine if you just set a private variable that specifies the card's state ("in deck" or such). Alternatively you can use an array that stores which cards are in each player's deck.

    Apart from that, I've got no experience with card games (creating them, that is), so I can't really advice much here :P

  • The array route probably ends up with less work, if your smart enough to organize the card states (in-deck, in-hand, in-play)

    The family route seems more simple to understand, grouping each card/sprite into families (FamilyA=PlayerA's Deck; FamilyB=PlayerB's Deck). Each card/sprite would also have their own private variable that changes from 'in-deck' to 'in-hand' to 'in-play', and back to 'in-hand' sometimes, which can be controlled with the FSM, correct?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
167 14,489
DMT2005's avatar
DMT2005
Unread hot topic
123 14,869
Zebbi's avatar
Zebbi
Unread hot topic
42 32,371
Ragevortex's avatar
Ragevortex