View Full Version : making a card game

arnold ape
05-20-2003, 02:13 PM

I'm a newcomer to actionscripting and in desparate need of some help with an idea i've had for a college project. Basically i want to create a card game where there are 12 cards face down on a table; there are two kinds of card: 6 of one kind ('good' cards), and 6 of another('bad' cards); placed in random order. The user turns over 4 cards (by clicking on them) - the aim of the game is to turn over more 'good' cards than 'bad' cards; if 3 good and 1 bad are turned then the game is won - if however, 3 bad and 1 good are turned then the game is lost, and obviously if 2 of each are turned the the game is drawn. After four cards are turned, a result is displayed and the game restarts.
Does anybody out there have any suggestions on any of these points because i have no idea where to start...


Arnold Ape

05-20-2003, 05:38 PM
you will need array that holds value of the cards

cardholder= new array("good1","good2","good3","good4","bad1",...etc)
and you need to shuffle that array.(i guess you will need shuffling code)
then you place the card according to that shuffled value.

that will give you basic structure.
try to make something anything and if you are stuck..ask again.

05-21-2003, 07:05 AM
Hi Arnold,

Welcome at AS.org! :)

Check the zip file... Tried to upload it yesterday but I guess the server was down. This might get you started... I couldn't really figger out how to avoid clicking twice on the cards. Maybe someone else has a solution for that...

arnold ape
05-21-2003, 05:49 PM

you are a legend!
thanks for your help - that was exactly what i wanted to do...just didn't know where to start - VERY much appreciated

arnold ape

arnold ape
05-21-2003, 08:14 PM
back again...

i'm having trouble putting a reset button in - is this because of the frame labels? any idea how to reset the game after the result is displayed? i tried a few methods but none seemed to work...:confused:

05-22-2003, 07:38 AM
Hi AA,

Make a (reset)button and place it on the second frame.
on (press) {
_root.good = 0;
_root.bad = 0;

Try to understand the AS in the first frame so you know what's going on. Otherwise you're gonna have trouble everytime you try to add/change something... ;)

If something's not clear, just ask. :)

Did you find a solution for the "multiple clicking problem"?

arnold ape
05-22-2003, 11:37 AM
Hi Avatar

I just wanted to say thanks for gettin back to me on that button question. The script on frame 1 is starting to make a little bit of sense now...made a few adjustments and got the whole thing working the way I imagined - just got to solve that multiple click thing...When the whole project is finished I'll send you the link and you can see your handiwork in glorious action!


Arnold Ape

:) :) :)

05-22-2003, 11:50 AM
No probs, man! :)
Like 2 c the result...