52 Card Deck

jaredjakesjaredjakes Member Posts: 2
edited November -1 in Working with GS (Mac)
How can I design a 52 card deck that is randomized. I am new to GameSalad and need to be pointed in the right direction.

Comments

  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    You and your arrays Tshirt ;)

    One day... One day! :P

    Ace
  • frariofrario Member Posts: 164
    it will be hard work.

    1. make 52 attributes and call them card1, card2... this is your deck.
    2. then make a random "machine" to achieve the goal of giving each attribute a single value (there are several ways)
    3. when picking up a card, read the first attribute on your deck (card1), store in another attribute (e.g. p1card1) and set card1 to 0.
    4. when picking successive cards, you have to make 52 rules that check if first card is = 0 then read second, if second is = 0 then read third... and so on until you get the next unused cards.

    **EDIT: you can do easier with an integer attribute "usedcards", but this is to allow to remix the USED cards only if you need to, preserving the ones already assigned**

    then there are other tons of things to do to make it work.

    After you have done all of this, you can do all the game rules.

    It would be feasible if it weren't for the fact that managing 52 nested rules means having to wait tens of seconds to open the actors, and then wait every time you perform the most basic action.
    Moreover, you will have to scroll with a lot of patience in expression editor, if you have 52 attributes.

    I did a game that's still in half-development. I wonder if I will never end it. Too much to wait for everything.

    But yes, you can do it!
  • jaredjakesjaredjakes Member Posts: 2
    @tshirtbooth

    Im so confused, I want the cards to be able to be flipped face down and then be flipped up too. This might take awhile.
  • calvin9403calvin9403 Member Posts: 3,186
    I hope arrays will be in the .9.2
  • hackmodfordhackmodford Member Posts: 48
    I'm with Tshirt booth on arrays... I used them all the time in multimedia fusion...
  • jjakesjjakes Member Posts: 1
    @tshirtbooth thats exactly what I needed. I was building something similar but I need to be able to draw from a deck. The game im making involves 2 players so thats TWO 52 card decks. Once I can get two decks Ill have a good base for my game.
Sign In or Register to comment.