[How should I?] Card Objects

0 favourites
  • 3 posts
From the Asset Store
Welcome! I-Spy (Hidden objects) is an educational puzzle that is more than just seek-and-find activities.
  • 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

  • Try Construct 3

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

    Try 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)