Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 05-20-2003, 02:13 PM   #1
arnold ape
Registered User
 
Join Date: May 2003
Location: swansea
Posts: 5
Send a message via AIM to arnold ape Send a message via Yahoo to arnold ape
Question making a card game

Hello

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...

Cheers

Arnold Ape
arnold ape is offline   Reply With Quote
Old 05-20-2003, 05:38 PM   #2
magicwand
Senior Member
 
magicwand's Avatar
 
Join Date: Oct 2002
Location: GA
Posts: 657
Default

you will need array that holds value of the cards
ActionScript Code:
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.
__________________
"If a man does not keep pace with his
companions, perhaps it is because he hears a different drummer." Thoreau
magicwand is offline   Reply With Quote
Old 05-21-2003, 07:05 AM   #3
avatar
Senior Member
 
avatar's Avatar
 
Join Date: May 2002
Location: Belgium - Antwerp
Posts: 456
Default

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...
Attached Files
File Type: zip cards.zip (20.4 KB, 1265 views)
__________________
Cheers,
Avatar
http://www.12create.be
avatar is offline   Reply With Quote
Old 05-21-2003, 05:49 PM   #4
arnold ape
Registered User
 
Join Date: May 2003
Location: swansea
Posts: 5
Send a message via AIM to arnold ape Send a message via Yahoo to arnold ape
Default

THANK YOU AVATAR!!!!!

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 is offline   Reply With Quote
Old 05-21-2003, 08:14 PM   #5
arnold ape
Registered User
 
Join Date: May 2003
Location: swansea
Posts: 5
Send a message via AIM to arnold ape Send a message via Yahoo to arnold ape
Default

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...
arnold ape is offline   Reply With Quote
Old 05-22-2003, 07:38 AM   #6
avatar
Senior Member
 
avatar's Avatar
 
Join Date: May 2002
Location: Belgium - Antwerp
Posts: 456
Default

Hi AA,

Make a (reset)button and place it on the second frame.
ActionScript Code:
on (press) {     _root.gotoAndStop(1);     _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"?
__________________
Cheers,
Avatar
http://www.12create.be

Last edited by avatar; 05-22-2003 at 09:47 AM.
avatar is offline   Reply With Quote
Old 05-22-2003, 11:37 AM   #7
arnold ape
Registered User
 
Join Date: May 2003
Location: swansea
Posts: 5
Send a message via AIM to arnold ape Send a message via Yahoo to arnold ape
Default thanks again!

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!

Cheers

Arnold Ape

arnold ape is offline   Reply With Quote
Old 05-22-2003, 11:50 AM   #8
avatar
Senior Member
 
avatar's Avatar
 
Join Date: May 2002
Location: Belgium - Antwerp
Posts: 456
Default

No probs, man!
Like 2 c the result...
__________________
Cheers,
Avatar
http://www.12create.be
avatar is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:18 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.