Card Game
i need some help with a card game pls
its very important
there are not any rules, but something like this maybe,
2 players, 1 computer and 1 human, you get
5 cards from the start, and you can put them out as
you want and as many you want. When you are ready click
a button then a textbox will appear. There you have to write
why you did it and then klick "OK" when you have done that you
gonna get new cards (you shall always have
5 cards, so if you got 2 cards left and klick the button
you shall have 3 new cards, and if you got 0 cards left you
gona get 5 new)and the first person that is out of cards win,
This is not any good idea for a card game :P but its a birthday
present to someone (its a joke, but you can impossibly understand
it :P) but i really really need som help pls !
i can make the drawin but i have no idé how to make the
programing
SitePoint > Design Your Site > Flash and Actionscript
Posted on: Mar 29, 2005, 22:21
View Complete Forum Thread with Replies
Sponsored Links:
[F8] Memory Style Card Game Card Flipping Issue
Hey guys,
I need a little help with a project I'm doing for school. I'm designing a memory style card game where you flip cards over and if they match they go away and stuff. You know what I mean. Anyway, I can't figure out how to tell both cards to revert to their original state if you guess wrong.
I have the last card you pressed flipping back over no problem. It's just the first one that won't do anything and I can't figure out how to reference it.
If anyone can help that'd be great.
View Replies !
View Related
Card Game (turn-based) - Lobby Room And Game Room, Maintain State
Hi all, I´m new in this forum, since now i appreciate for any help.
I´m developing a turn-based card game in Flash 8 (multiplayer), using the concepts of lobby and room. In this case when the user login de game, he always see the lobby, where he can choice the games, then the user selects a game in a dataGrid and enter the game.
Inside the game (that resides in another frame in my .fla), there is a button that when clicked brings de users to the main lobby ( gotoAndStop(“lobby”) ) so that the user can visualize the lobby with the game running in background with the others users.
The problem is when the user return to the game ( gotoAndStop(“game”) ), the images, cards, players name and chat history text disappear, all the game object disappear, remaining only the original graphics (movie clips) to the game room.
In fact, I need a solution to maintain the state of the game when the user decide to visualize the lobby (with the game running) and after return to the game.
Thanks for any help.
Regards,
Luiz Filipe (CURURU)
Os: Sorry for my bad english -
View Replies !
View Related
Card Game
i need some help with a card game pls
its very important
there are not any rules, but something like this maybe,
2 players, 1 computer and 1 human, you get
5 cards from the start, and you can put them out as
you want and as many you want. When you are ready click
a button then a textbox will appear. There you have to write
why you did it and then klick "OK" when you have done that you
gonna get new cards (you shall always have
5 cards, so if you got 2 cards left and klick the button
you shall have 3 new cards, and if you got 0 cards left you
gona get 5 new)and the first person that is out of cards win,
This is not any good idea for a card game :P but its a birthday
present to someone (its a joke, but you can impossibly understand
it :P) but i really really need som help pls !
i can make the Drawin but i have no idé how to program
pls help
View Replies !
View Related
Card Game
Do anyone knows which script is for picking up the card? The script looks so strange. Read it many time but not sure what they are going on
View Replies !
View Related
[F8]Card Game ?
I'm tring to figure how to make a flash application where a user clicks a button and it will display three card. The problem is is I don't even know where to start.
Thanks in advance
View Replies !
View Related
Card Game
I want to randomly flash 13 cards on screen. How do I do it using action script? I do not want to create an image of all 52 cards. want them to be created dynamically. Can anybody help?. I am using flash mx.
View Replies !
View Related
Card Game Help
i am trying to make a card game where when u click on a btn a function chooses a random number then based on that random number an instance of a certain card is created, and it cannot be created again due to the fact that there is a boolean varyable that i check when i try to make the card, and if the card was made already it cannot be made again and it trys to draw another card. it wont do any of this if the number of cards draw is = to the amount of cards there are.
i made something like this, but i wana use less functions and ifs as of now i have a big mess, how would u guys do it
View Replies !
View Related
Card Game Help
I have a game named Tripoley.
What happens is the dealer shuffles the deck, and passes the cards out to everyone, until all the cards are dealt out. He gives every player 1 deck, plus makes an extra deck. If the dealer doesn't like his hand, he can switch his deck with the extra deck. Whatever deck he doesn't choose does not get used for the rest of the game.
The person on his left plays their lowest red/black card, 2 being the lowest number, face up in the center of the board. The next number of the same suit is played by whoever has it. When nobody has the next card in the same suit, the last player to play plays their lowest card of the opposite color of what was played last. (If a four of hearts was played last, a low black card has to be played next).
Does anybody have any tips on how to make this game?
If you don't get these instructions, or you need the rest, I can post them.
Thanks,
--Blatex24
View Replies !
View Related
Card Game
I want to randomly flash 13 cards on screen. How do I do it using action script? I do not want to create an image of all 52 cards. want them to be created dynamically. Can anybody help?. I am using flash mx.
Edited: 08/20/2007 at 07:55:00 AM by nandoo19
View Replies !
View Related
Card Game
hello guys,
i have a big problem. i have made a card game with four person to play.
but, there is a problem that whenever a player becomes out by means of "no card". at that time, it becomes unresponsive.
that means it gives wrong player mode.
i have added my code. i m putting some ideas about whatever i have writtten:
1. attackerIndex is the attacker.
2. defenderIndex is the defender.
3. attackerIndex1 is waitng player to play in a round that is being given by attacker.
4. attackerIndex2 is same as attackerIndex1.
but, what happens? as soon as cards of a player goes end, i have updated total player. that time,
as example :-
attackerIndex - 0;
defenderIndex- 1;
attackerIndex-2;
attackerIndex-3;
after one round complete: - when a player like defender's cards have gone ended.
at that moment, it should be :
attackerIndex1 = 2;
defenderIndex = 3;
attackerIndex2 = 0;
attackerIndex3 = blank;
but it happens like that attackerIndex1 = 2;
defenderIndex = 0;
attackerIndex2 = 1;
once to be noted this game can be played among three player also.
i hope i get its solution as soon as possible.
with best hopes,
saurabh
Textonce to be noted this game can be played among three player also.
code :
if (application.playerCount == 4) {
application.attackerIndex1 = (application.defenderIndex + 1) % application.playerCount;
application.attackerIndex2 = (application.attackerIndex1 + 2) % application.playerCount;
application.attackerIndex3 = (application.attackerIndex1 + 3) % application.playerCount;
application.defenderIndex = (application.attackerIndex1 + 1) % application.playerCount;
} else if (application.playerCount == 3) {
application.attackerIndex1 = (application.defenderIndex + 1) % application.playerCount;
application.attackerIndex2 = (application.attackerIndex1 + 2) % application.playerCount;
application.defenderIndex = (application.attackerIndex1 + 1) % application.playerCount;
} else if (application.playerCount == 2) {
application.attackerIndex1 = (application.defenderIndex + 1) % application.playerCount;
application.defenderIndex = (application.attackerIndex1 + 1) % application.playerCount;
}
View Replies !
View Related
Making A Card Game
I'm making a card game, and I'm randomly giving the player and three computer players cards. The only problem is, I can't figure out how to check in an array if something already exists (so that, for example, player one and three don't both get the three of clubs).
Thanks for your help.
View Replies !
View Related
Card Game Help (flash5)
Hi,
I'm designing a solitare card game, and I need help. I've looked throughout the site for a .fla file, but can't seem to find one.
The problem I am alrady having, is how to shuffle and deal the cards. I have structured the movie, so that there is a movie called 'cards' which contains the individual card images, in frames 1-52, frmaes 53-56 contain jokers (not to be shuffled) and frame 57 contains the image of the back of the cards.
To start with, I want the program to shuffle the cards and then deal them face up onto the stage. One next to the other.
Does anyone have an idea how I can use an array to 'shuffle' the cards (I assume by assigning each card a number for the order in which they are set to appear)?
Thanks.
View Replies !
View Related
3 Card Monte Game
i'm attempting to create my first game in flash, unfortunately i'm not very advanced in actionscript. i want to make a 3 card monte game, where it will randomly move 3 objects around and then stop. the user would click on an object and only 1 will have a coin under it. they can either get it right or wrong.
my idea was to create 1 movie clip that holds all of the moves each object can make. (ex. object 1 moves to position 3 and object 3 moves to position 1) then i would set up an array for all the moves...
moves = new array();
moves[1] = _root.clip.gotoandplay("move1");
moves[2] = _root.clip.gotoandplay("move2");
moves[3] = _root.clip.gotoandplay("move3");
and then i would somehow randomize the array to keep playing random moves for a total of lets say 20 times. the user would then click on an object. there is a coin under each object but they are invisible. the right object will make the coin visible underneath it.
what do u think? is this possible? can anyone give me some pointers and the proper coding to randomize an array? i've never used the random command in flash, or the array command for that matter. any help would be greatly appreciated. thanks!
View Replies !
View Related
Memory Card Game
Hello all,
I am web designer; I am learner in action scripts
I wanted to create a flash game (memory card game) and score should be saved in to database. Please suggest me how use python/perl
Can u help me in this.. http://www.cleverpig.com/examples/memory.htm this is the sample url
I wanted to make same as this but result (score) will be saved in BD.
Warm Regards
Rajeev
View Replies !
View Related
Help Wanted With Card Game
Hi,
Im new here, and to Flash MX, so be gentle. I want to create a game similar to http://www.nfluk.com/features/features-nfltrumps.php. But ive no idea how. Ive searched around on this site/forums, and cant find anything. Does anyone know of any tutorials out there? If this isnt the right forum, I apologise. Could someone direct me to a better forum to get some help? Thanks
View Replies !
View Related
Blackjack Card Game....
Hi guys I was wondering if anyone had a Black jack card game they would be willing to have in the game im putting together... its an rpg game. please if someone has the source and is willing to let me implement there game please post the .fla or if you will let me see how its done that would be greatly appreciated. Thanks alot.
Matt
View Replies !
View Related
Memory Card Game (almost Done)
Hiya,
I'm trying to make a memory cards game but I am stuck...
I dont know why the game ismt working.
here is the fla-
http://members.lycos.co.uk/xtks/poke_m.fla
can u tell me pkease what do I need to add to make it work?
thanks
View Replies !
View Related
Shuffle Card Game
Hi all! I am posting an .fla of what I am trying to do, perhaps someone can help me figure it out.
I am creating a card game, and at the end of the game if the player wants to replay the game, I want my
cards to shuffle. What I have managed so far in this demo file, is when the game starts the movie clips
are placed in certain positions on the stage, and when you press the button instead of shuffeling...all
movie clips are placed behind the other and they all move along. What I want instead is on each mouse
press, the cards to swap places and only one movie clip per place! Appreciate anyone's wisdom!
P.s. I HAVE flash Mx...NOT...flash MX 2004.
View Replies !
View Related
Card Game War -- Array HELP
This is a very newbie question, I understand. But I'm trying to make a simulator of the card game war. I haven't even tried to simulate when the game goes to war, so I have just made a tie equal to a loss. But still, it isn't working. I'm trying to keep track of wins, losses, ties, tie wins, tie losses, and the number of hands dealt. There are 8 decks being used. I created an array with each card contained in it. 2's are given the name 2, 3's are 3, etc and Ace's are 14. Then when a button is pressed I want to choose a random item in the array, display it as your card, delete it from the array, choose another item from the new array, display it as the dealer card, and delete it from the array. I've made the starting bankroll 1000 dollars, the original bet 5, and if you win the bet stays the same, and when you lose or tie the bet doubles. I would like to make it so that your maximum bet is 300 dollars. To make this simpler I've just attached the file. Also, I have a box that shows the array length because I just wanted to see if it was working right. Basically, I need A LOT OF HELP!!!! thanks so much...
View Replies !
View Related
Card Game Online?
Hi.
Is it possible to make an online card game with flash? I'm talking about a multiplayer game, which means that my cards (which i can see) cannot be seen by other players during game (the ordinary stuff). Is this achievable?
View Replies !
View Related
[F8] Memory Card Game
Hello there,
I´m creating a card game and I'm having problems with the animation part. Here are the details:
I have:
1 movie clip call Carta that contains the animation for showing the card, this is the layer that I'm going to drag into the main stage. This mc is made of
-- 1 mc called cartaFrente instanciated as "cartaCara" that contains all the front images I would like to show to the user
-- 1 image containing the back part of the cards.
In the main stage I create an instance for Carta, in this case the instance name is "LaCarta"
in the firts frame I duplicate the instance LaCarta, then bring into the scene changin _x and _y also in this frame I'm trying to show the 2nd card in my Deck, here is the code:
duplicateMovieClip(_root.LaCarta,"mcCarta",1);
with(this["mcCarta"]){
_x = 100;
_y = 100;
_root.laCarta.cartaCara.gotoAndStop(2);
}
In the onRelease event for LaCarta I play the main mc:
on (release) {
_root.LaCarta.play();
}
when running this stuff I click on the mc but nothing happens! What I think it is suppose to run is that when I click then I would be able to see the 2nd card.
Please help me, I cannot find what I'm doing wrong, I'm using flash 8 and ActionScript 2.0
Thank you friends!
View Replies !
View Related
Snap Card Game
Snap Game
Hi everyone/anyone
I’m about to start creating a snap game. Was wondering if anyone could point me in the direction of any examples. Haven’t really had much luck finding any.
So my strategy is below, could anyone confirm I’m heading in a logical direction with this since im kind of new to the action script side of flash since I spent my previous life working with the time line and attaching simple script to buttons and the like?? I could get the snap game working but not with the sequence of cards changing… I know that flash can be “Dynamic” and want to move in this direction.
MY PLAN:
Two movieclips to hold the images for each pile of cards. Contained on frames 1 – 10 within each movieclip.i.e.
mc_chooseCard1
mc_chooseCard2
Generate 2 random numbers between 1 and 10 (10 being the number of individual images to display for each card)
Code for this:
function myRandom (minVal, maxVal) {
return minVal + Math.floor(Math.random()*(maxVal + 1 - minVal));
}
chooseCard1 = myRandom(1, 10);
chooseCard2 = myRandom(1, 10);
trace (chooseCard1);
trace (chooseCard2);
Then jump to the frame number that is randomly generated within mc_chooseCard1&2.
pics1.gotoAndStop(chooseCard+1);
pics2.gotoAndStop(chooseCard2+1);
If random no mc_chooseCard1 == mc_chooseCard2 then snapCount = snapCount +1 if snap button is pressed during this match.
I will also need to include a time delay controller allowing to speed up or slow down the speed that the cards change. I assume I can control the speed that it jumps to the next frame, but this is again something I’m looking into.
Thanx,
New flasher
View Replies !
View Related
Shuffle Card Game
Hi all! I am posting an .fla of what I am trying to do, perhaps someone can help me figure it out.
I am creating a card game, and at the end of the game if the player wants to replay the game, I want my
cards to shuffle. What I have managed so far in this demo file, is when the game starts the movie clips
are placed in certain positions on the stage, and when you press the button instead of shuffeling...all
movie clips are placed behind the other and they all move along. What I want instead is on each mouse
press, the cards to swap places and only one movie clip per place! Appreciate anyone's wisdom!
P.s. I HAVE flash Mx...NOT...flash MX 2004.
View Replies !
View Related
Snap Card Game
Snap GameHi everyone/anyone
I’m about to start creating a snap card game. Was wondering if anyone could point me in the direction of any examples. Haven’t really had much luck finding any.
So my strategy is below, could anyone confirm I’m heading in a logical direction with this since im kind of new to the action script side of flash since I spent my previous life working with the time line and attaching simple script to buttons and the like?? I could get the snap game working this way but not with the sequence of cards changing… I know that flash can be “Dynamic” and want to move in this direction.
MY PLAN:
Two movieclips to hold the images for each pile of cards. Contained on frames 1 – 10 within each movieclip.i.e.
mc_chooseCard1
mc_chooseCard2
Generate 2 random numbers between 1 and 10 (10 being the number of individual images to display for each card)
Code for this:
function myRandom (minVal, maxVal) {
return minVal + Math.floor(Math.random()*(maxVal + 1 - minVal));
}
chooseCard1 = myRandom(1, 10);
chooseCard2 = myRandom(1, 10);
trace (chooseCard1);
trace (chooseCard2);
Then jump to the frame number that is randomly generated within mc_chooseCard1&2.
pics1.gotoAndStop(chooseCard+1);
pics2.gotoAndStop(chooseCard2+1);
If random no mc_chooseCard1 == mc_chooseCard2 then snapCount = snapCount +1 if snap button is pressed during this match.
I will also need to include a time delay controller allowing to speed up or slow down the speed that the cards change. I assume I can control the speed that it jumps to the next frame, but this is again something I’m looking into.
Thanx,
New flasher
View Replies !
View Related
Help Trying To Make A Card Game In AS2
Hey guys, I have a problem that needs immediate help.
I have a card game in which the user selects 6 cards from a deck, and they go face down on the table. Then the user can click the cards in turn to flip them over, revealing one of 72 different card faces that I am loading through an XML file.
My problem is twofold. First off, each card needs to be unique. That means that the user should never encounter the same card twice in one draw. Currently it is possible to get the same card six times in a row. I know I need to use some sort of exclusion variable but I have no idea what the syntax should be, or where it should go in my script.
My second problem is probably easier, but I am rusty with Flash and I'm not sure how to solve it without breaking my code. Basically, a user can continually click one card, "flipping" the same card over and over to get a different card face. I only want them to be able to click a card once, and once its done, they have to move to the next one.
I have linked my code and XML code below. A lot of it is from help I have gotten from these boards and other sources in the past. I'm trying to finish this ASAP - Please help!
PHP Code:
stop();
var thisCard:MovieClip
var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",10000);
tooltip._alpha = 0;
var imageFileName:Array = [];
var cardXML:XML = new XML();
cardXML.ignoreWhite = true;
cardXML.onLoad = loadImages;
cardXML.load("cardXML.xml");
function loadImages(loaded) {
if (loaded) {
var nodes = this.firstChild.childNodes;
totalImages = nodes.length;
for (i=0; i<totalImages; i++) {
imageFileName[i] =nodes[i].attributes.img;
}
trace(imageFileName);
//<--See if the array is populated
//Load finish.
//Now you can assign the release handler to the card MovieClip.
for (a=1;a<=6;a++){ // Assign the release handler to all (6) clips
var Clip=_root["card"+a] // Assume cards are in the _root (main) stage
// (otherwise you must give the right target path, eg: _root.Container["card"+a] -if inside a "Container" clip-)
Clip.invis.onRelease = releaseHandler;
}
}
}
function flipCard() {
var RandomImage=getRandomImage() // With the old code you would get 2 different random values..
trace("Load "+RandomImage+" to "+_root.thisCard.inner);
thisCard.inner.loadMovie(RandomImage);
}
//This function returns a random image filepath
function getRandomImage():String {
var ran = Math.round(Math.random()*(totalImages-1));
return imageFileName[ran];
}
function releaseHandler():Void {
thisCard = this._parent;
flipCard();
}
// Reset all cards (removes any loaded images from cards)
//(REQUIRES a button on stage named: "resetButton")
resetButton.onRelease=function(){ //Just in case you need it..
for (a=1;a<=6;a++){
var Clip=_root["card"+a] // Assume cards are in the _root (main) stage
unloadMovie(Clip.inner)
}
}
My XML code: (Note - not all images are plugged in yet, I want to get the flash working first)
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<cardXML>
<image title="Air" img="images/air/air.jpg" type="air" tag = "1"
descripText = ""
/>
<image title="Archangel Raphael" img="images/air/archangel_raphael.jpg" type="air" tag = "2"
descripText = ""
/>
<image title="Birth" img="images/air/birth.jpg" type="air" tag = "3"
descripText = ""
/>
<image title="Copper" img="images/air/copper.jpg" type="air" tag = "4"
descripText = ""
/>
<image title="Crow" img="images/air/crow-card.jpg" type="air" tag = "5"
descripText = ""
/>
<image title="Dagger" img="images/air/dagger.jpg" type="air" tag = "6"
descripText = ""
/>
<image title="Dawn" img="images/air/dawn.jpg" type="air" tag = "7"
descripText = ""
/>
<image title="Flexibility" img="images/air/flexibility.jpg" type="air" tag = "8"
descripText = ""
/>
<image title="Hazel Tree" img="images/air/hazel-tree.jpg" type="air" tag = "9"
descripText = ""
/>
<image title="Intellect" img="images/air/intellect.jpg" type="air" tag = "10"
descripText = ""
/>
<image title="Mental Body" img="images/air/mental-body.jpg" type="air" tag = "11"
descripText = ""
/>
<image title="Mind" img="images/air/mind.jpg" type="air" tag = "12"
descripText = ""
/>
<image title="New Moon" img="images/air/new-moon.jpg" type="air" tag = "13"
descripText = ""
/>
<image title="Ostara" img="images/air/ostara.jpg" type="air" tag = "14"
descripText = ""
/>
<image title="Ram's Horns" img="images/air/ram's-horns.jpg" type="air" tag = "15"
descripText = ""
/>
<image title="Septagram" img="images/air/septagram.jpg" type="air" tag = "16"
descripText = ""
/>
<image title="Smell" img="images/air/smell.jpg" type="air" tag = "17"
descripText = ""
/>
<image title="Spring" img="images/air/spring.jpg" type="air" tag = "18"
descripText = ""
/>
<image title="Thinking" img="images/air/thinking.jpg" type="air" tag = "19"
descripText = ""
/>
<image title="Topaz" img="images/air/topaz.jpg" type="air" tag = "20"
descripText = ""
/>
<image title="Yellow" img="images/air/yellow.jpg" type="air" tag = "21"
descripText = ""
/>
<image title="Archangel Uriel" img="images/earth/archangel-uriel.jpg" type="earth" tag = "22"
descripText = ""
/>
<image title="Balance" img="images/earth/balance.jpg" type="earth" tag = "23"
descripText = ""
/>
<image title="Bison" img="images/earth/bison.jpg" type="earth" tag = "24"
descripText = ""
/>
<image title="Black" img="images/earth/black.jpg" type="earth" tag = "25"
descripText = ""
/>
<image title="Body" img="images/earth/body.jpg" type="earth" tag = "26"
descripText = ""
/>
<image title="Earth" img="images/earth/earth.jpg" type="earth" tag = "27"
descripText = ""
/>
<image title="Elm" img="images/earth/elm.jpg" type="earth" tag = "28"
descripText = ""
/>
<image title="Grounding" img="images/earth/grounding.jpg" type="earth" tag = "29"
descripText = ""
/>
<image title="Helm Of Awe" img="images/earth/helm-of-awe.jpg" type="earth" tag = "30"
descripText = ""
/>
<image title="Lead" img="images/earth/lead.jpg" type="earth" tag = "31"
descripText = ""
/>
<image title="Midnight" img="images/earth/midnight.jpg" type="earth" tag = "32"
descripText = ""
/>
<image title="Old Age" img="images/earth/old-age.jpg" type="earth" tag = "33"
descripText = ""
/>
<image title="Pentacle" img="images/earth/pentacle.jpg" type="earth" tag = "34"
descripText = ""
/>
<image title="Physical Body" img="images/earth/physical-body.jpg" type="earth" tag = "35"
descripText = ""
/>
<image title="Quartz" img="images/earth/quartz.jpg" type="earth" tag = "36"
descripText = ""
/>
<image title="Sensation" img="images/earth/sensation.jpg" type="earth" tag = "37"
descripText = ""
/>
<image title="Touch" img="images/earth/touch.jpg" type="earth" tag = "38"
descripText = ""
/>
<image title="Unicursal Hexagram" img="images/earth/unicursal-hexagram.jpg" type="earth" tag = "39"
descripText = ""
/>
<image title="Waning Moon" img="images/earth/waning-moon.jpg" type="earth" tag = "40"
descripText = ""
/>
<image title="Winter" img="images/earth/winter.jpg" type="earth" tag = "41"
descripText = ""
/>
<image title="Yule" img="images/earth/yule.jpg" type="earth" tag = "42"
descripText = ""
/>
</cardXML>
View Replies !
View Related
Easy Pick A Card Game
I want to create a simple flash card game where the user has to choose between 3 cards in which they must choose the ace.
The cards have the backs showing and the user clicks and it will either show an ace or a jack or king etc, and this will repeat again after a mouse click or after a certain amount of time passes. Can anyone help me out with the actionscripting? is it a difficult task. Im a beginning actionscripter and have only just mastered controlling multiple movies..
View Replies !
View Related
Memory Card Game _ Need Some Help With Creating It
Hello Guys & Gals,
I had a tutorial I was using quite a while back to create a 'memoy card' game- You know- clcik a card it turns over-- you try to match that image with the same image on another card which then eliminates the pair- etc... until you have them all matched!
I know...simple game! Well... I am new to designing any game in Flash--so I am making a simple memory game for a kids site.
Is Anyone out there able to assess what is wrong with my code to this point?
It seems to add too many cards--and it doesn't match up an equal amount of paired graphics- it always seems like when you get to near the end- there is like 4 cards left- each with a different image on it that doesnt match any others!
If anyone can help- or direct me to some help that would be AWESOME!!
Thanks...I will include the code with this post...
Thanks in advance!
View Replies !
View Related
[F8] Programing A Trading Card Game AI
I made my own trading card game and i would like to build a flash game around it and i want to build an AI to play against. I know that there is a way to do this in ActionScript 2.0 but it will take some doing. I would like some help, if you have any existing systems like what i am trying to build i would love to see it. I would love any advice you can offer on how to program this.
Thanks
View Replies !
View Related
Mathing Game Wild Card
Hello. I've created a matching game and would like to add a wildcard function which removes the matching card any time the wild card is drawn.
Following is the code.
If you need more info, simply let me know. It's my first time to post a thread.
Thanks,
Matt
package {
import fl.controls.Button;
import fl.controls.TextArea;
import flash.text.TextField;
import flash.text.TextFieldType;
import flash.text.TextFormat;
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.events.TimerEvent;
import flash.utils.Timer;
public class color_match extends Sprite {
var integer:Number;
private var first_tile:FlagsMOV;
private var second_tile:FlagsMOV;
private var pause_timer:Timer;
// This section creates a deck of cards and shuffles it randomly.
// In the movie, frames 1-25 are numbered card backs and 26-50 are the matching pairs.
var colordeck:Array = new Array(26,27,28,29,30,31,32,33,34,35,36,37,38,39,40 ,41,42,43,44,45,46,47,48,49,50);
public function color_match() {
for (x=1; x<=5; x++) {
for (y=1; y<=5; y++) {
if (y == 1) {
integer = (x * y);
} else if (y > 1) {
integer = (x + (5 * (y-1)));
}
// Integer is used below to go to the correct frame so the card backs are in numerical order.
var random_card = Math.floor(Math.random()*colordeck.length);
var random_tile = Math.floor(Math.random()*colordeck.length);
var tile:FlagsMOV = new FlagsMOV();
// This section pulls from the above array and places the cards on the stage.
tile.col = colordeck[random_card];
trace(tile.col);
colordeck.splice(random_card,1);
tile.gotoAndStop(integer);
tile.x = (x-1)*144;
tile.y = (y-1)*108;
tile.addEventListener(MouseEvent.CLICK,tile_clicke d);
addChild(tile);
}
}
}
// This section reveals the cards.
public function tile_clicked(event:MouseEvent) {
var clicked:FlagsMOV = (event.currentTarget as FlagsMOV);
var clicked2:FlagsMOV = (event.currentTarget as FlagsMOV);
if (first_tile == null) {
first_tile = clicked;
first_tile.gotoAndStop(clicked.col);
} else if (second_tile == null && first_tile != clicked) {
second_tile = clicked2;
second_tile.gotoAndStop(clicked2.col);
// this section checks if they are a match. The matches are in adjacent frames.
if (Math.floor(first_tile.col/2) == Math.floor(second_tile.col/2)) {
pause_timer = new Timer(1000,1);
pause_timer.addEventListener(TimerEvent.TIMER_COMP LETE,remove_tiles);
pause_timer.start();
} else {
pause_timer = new Timer(1000,1);
pause_timer.addEventListener(TimerEvent.TIMER_COMP LETE,reset_tiles);
pause_timer.start();
}
}
// This section resets the tiles if they are not a match.
// Depending on the location of the tile, it goes to the appropriate frame so the number on the card back stays the same.
function reset_tiles(event:TimerEvent) {
var tep:Number;
var tep2:Number;
if (first_tile.y == 0) {
tep = ((first_tile.y + (first_tile.x / 144) + 1));
} else if (first_tile.y > 0) {
tep = (((first_tile.x / 144) + (5 * (first_tile.y / 108))) + 1);
}
first_tile.gotoAndStop(tep);
if (second_tile.y == 0) {
tep2 = ((second_tile.y + (second_tile.x / 144) + 1));
} else if (second_tile.y > 0) {
tep2 = (((second_tile.x / 144) + (5 * (second_tile.y / 108))) + 1);
}
second_tile.gotoAndStop(tep2);
first_tile = null;
second_tile = null;
pause_timer.removeEventListener(TimerEvent.TIMER_C OMPLETE,reset_tiles);
}
// This section removes the tiles if they are a match.
function remove_tiles(event:TimerEvent) {
removeChild(first_tile);
removeChild(second_tile);
first_tile = null;
second_tile = null;
pause_timer.removeEventListener(TimerEvent.TIMER_C OMPLETE,remove_tiles);
}
}
}
}
View Replies !
View Related
Card Game Black Jack
Hi. I need some advice on how to actionscript a simple blackjack game Im working on. I've always found it difficult to learn something without examples, and I cant find any on this subject lol. So heres what I got. The games going to be really simple with the correct rules of blackjack. A dealer and 1 player.
I have created the playing cards. I did it like this. I have a movieclip called PlayingCard containing everything about the cards. Inside PlayingCard is a movieclip called Card and contains 1 frame on the timeline with nothing going on. Inside the movieclip card I have all of the cards each on its own frame. Like this, frame 1 is the back of the card, frame 2 is the Ace of Spades and so on with frame 3 being 2 of spades and so one thru all of the suits and cards being in order (spades, clubs, diamonds, hearts) in all its 53 frames.
Right now this is what Im looking for: asign value to the frames, meaning the face cards will be 10, number cards will be the value they represent(2 is 2, 6 is 6) and the ace can be 11 or 1 depending wether or not the player stays and if he doesnt if the 11 will bust him it defaults to 1. A way to have the cards be chosen at random(frame 2 thru 53) right before the card is "delt" kind of shuffle on the fly. The next cards "delt" cannot be the same as any of the cards already in play or on stage.
If anyones interested in helping me I would really appreciate it. Im asking for a complete explaination of the method you suggest, with details lol. Thanks.
View Replies !
View Related
Card Game Action Script
I am trying to create a flash card game similar to Uno. Is there a way to create a flash card game at all? I have never seen it done before and, I was wondering can it be done before I even try. you can e-mail me for more detail on the kind of card game I am trying to work on if you like.
View Replies !
View Related
How Do I Connect To (card/board) Game Servers
I'm interested in creating a range of board and card games in Flash. While these could be played with others using the same swf, there would always be someone to play against if I could connect them to public servers (eg .chess / backgammon / poker etc.). I can't find any info on how to do this. Any sugestions.
(also looking for AI so some of the games can be played against the computer)
View Replies !
View Related
“Matching Pairs Card Game” But With 48 Cards
Hi I’m trying to modrate this memory game
http://www.flashkit.com/movies/Games...7285/index.php
I want it to be able to pair a picture to fx. a card with a word on. Only tested it on photo1 so far, but seems to work.
I also want it to have 48 cards instead of 24, but for some reson
it only shows 36 cards...and i have no clue why.
Can any one help me or give me a hint of whats wrong.
(I’m a newb at this actionsripting )
I've attached the file I'm working on.
/Heidi
View Replies !
View Related
Concentration Game, Card Flip Delay
I completed a CS3 actionscript tutorial on lynda to build a concentration game. The game works, but now I would like to delay the amount of time before two non matching cards flip back over. A guy gave me some info on the adobe forums, but that didn't really help. He suggested I put a timer function in, which I have no clue about now I get an:
TypeError: Error #1010: A term is undefined and has no properties.
at MethodInfo-16()
at flash.utils::Timer/flash.utils:Timer::_timerDispatch()
at flash.utile::Timer/flash.utile:Timer::tick()
The code from the method in the class that checks the cards and does the flipping is below:
Code:
private function checkMatch(event:MouseEvent):void
{
event.currentTarget.removeEventListener(MouseEvent.CLICK, checkMatch);
var delayTimer:Timer = new Timer(2000, 1); // variable for timer, delay of 2 seconds
delayTimer.addEventListener("timer", cardTurnF);
var _secondCard:*; //Implicit coercion of a value with static type... error when type MovieClip
function cardTurnF(evt:TimerEvent):void
{
trace("first card type is " + _firstCard);
_firstCard.gotoAndPlay("flipBack");
_secondCard.gotoAndPlay("flipBack");
}
if(_firstCard == undefined)
{
//event.currentTarget captures event from _card
_firstCard = event.currentTarget;
trace("Card Type is undefined");
}
else if(String(_firstCard._type) == String(event.currentTarget._type))
{
trace("Match Made!");
_firstCard = undefined;
_currentMatches ++;
trace(_currentMatches + " current matches.");
if(_currentMatches >= _totalMatches)
{
trace("You Win!");
}
}
else
{
trace("Wrong No Match");
trace("first card is" + _firstCard);
//_firstCard.gotoAndPlay("flipBack");
//event.currentTarget.gotoAndPlay("flipBack");
_secondCard = event.currentTarget;
delayTimer.start();
trace("timer started"); // remove later
_firstCard.addEventListener(MouseEvent.CLICK, checkMatch);
event.currentTarget.addEventListener(MouseEvent.CLICK, checkMatch);
_firstCard = undefined;
}
}
View Replies !
View Related
Problem With Memory Card Game Code - Please Help?
Hi all, I hope someone can help me with this.
I am creating a simple memory card game in Flash 8 with 10 cards. For anyone who's unfamiliar with the concept, the user gets a quick look at the faces on the cards before the cards are flipped face down, and the user then has to try to find pairs of faces (10 cards = 5 pairs). In theory, each time the user plays the game, the face images are populated randomly so it's a new game each time. The problem I am having is that with the code I've written, some of the cards are coming up blank, which means not all 5 faces are represented on the cards. Below is the function I wrote to populate the card faces:
Code:
_global.loadCards = function () {
trace ("you are accessing the loadCards function")
var randomUsed = false;
var listOfRandoms = new Array ();
for (i=1; i<=10; i++){
var newRandom = int(Math.random()*11);
if (newRandom == 0){
newRandom = 1;
/*for (j=1; j <= listOfRandoms.length; j++){
if (newRandom == listOfRandoms[j]){
randomUsed = true;
break;
} else {
randomUsed = false;
}
}*/
}
trace ("newRandom is " + newRandom);
listOfRandoms[i] = newRandom;
trace("List of randoms is "+listOfRandoms.length+" long");
trace(listOfRandoms);
/*for (j=1; j <= listOfRandoms.length; j++){
if (newRandom == listOfRandoms[j]){
randomUsed = true;
break;
} else {
randomUsed = false;
}
}*/
if (rabbitCounter < 2 && randomUsed == false){
_root["card"+newRandom].animalContainer.attachMovie("rabbitNodding", "animal", 1);
_root["card"+newRandom].clickValue = "rabbit";
rabbitCounter++;
trace ("rabbitCounter is " + rabbitCounter);
} else if (sheepCounter < 2 && randomUsed == false){
_root["card"+newRandom].animalContainer.attachMovie("sheepWalking", "animal", 1);
_root["card"+newRandom].clickValue = "sheep";
sheepCounter++;
trace ("sheepCounter is " + sheepCounter);
} else if (raccoonCounter < 2 && randomUsed == false){
_root["card"+newRandom].animalContainer.attachMovie("raccoonHopping", "animal", 1);
_root["card"+newRandom].clickValue = "raccoon";
raccoonCounter++;
trace ("raccoonCounter is " + raccoonCounter);
} else if (foxCounter < 2 && randomUsed == false){
_root["card"+newRandom].animalContainer.attachMovie("foxJumping", "animal", 1);
_root["card"+newRandom].clickValue = "fox";
foxCounter++;
trace ("foxCounter is " + foxCounter);
} else if (beaverCounter < 2 && randomUsed == false){
_root["card"+newRandom].animalContainer.attachMovie("beaverHovering", "animal", 1);
_root["card"+newRandom].clickValue = "beaver";
beaverCounter++;
trace ("beaverCounter is " + beaverCounter);
}
if (randomUsed == true){
i--;
}
}
}
You'll note that there is a second for loop nested within the first. Actually, it is in there twice, and I have it commented out in both places at the moment because I don't know where it is supposed to go, AND it tends to cause flash to crash entirely when I try to test the movie if I uncomment it in either spot. But a friend who's more familiar with AS than I am helped me with this code and he put it in there. I believe it (or something similar) needs to be there somewhere, as it is meant to check that the random number that is generated during an iteration of the first for loop hasn't been used before (which is what determines which card will be populated with which face), but I don't know how to fix it at all.
Any help with this would be much appreciated, as I have a deadline approaching
Thanks so much in advance...
View Replies !
View Related
Has Anyone Ever Action Scripted Card Dealing In A Poker Game?
I'm messing around, trying to figure out how to action script a simple poker game in Flash4.
I'm having a problem trying to script out the same card "randomly" appearing in more than 1 of the 5 different card positions of the movie clips when my "deal cards" button is clicked.
This is what I have so far:
(A) I have a movie clip with the entire deck of cards that has a stop action on each frame (1 card graphic per frame);
(B) I have that clip copied into 5 position on the stage and named them as 5 different instances (position-1 through position-5);
(C) I have a deal button that uses the tell target command (and the random function) 5 times in a row to fetch a frame (with a card graphic in it) for each of the five card (movie clip) positions (with their instances called out).
(D) When the 5 cards appear, often the same card appears in 2 of the 5 positions. That's the core of the problem.
So my question is - how can I make sure that 5 different cards always appear in these 5 movie instances (as if an actual deck of cards was dealt)?
How can I use action scripting to prevent a card (frame) from being chosen randomly - twice, in these five separate movie clips? (because it's starting to look more like a slot machine game than a poker game )
Does my movie clip structure make this goal impossible and is there a more appropriate way to structure a deck of cards for poker (that avoids duplicate cards) than I have described?
If anyone has ever gone through this exercise ever before, I'd sure appreciate the help (my noggin is starting to grow a flat spot on top trying to figure this one out )
Thanks in advance!
- James
View Replies !
View Related
[F8] - Card Memory Game (simple Script) HELPO
Hey there! I hope you guys can help me because im a bit desperate and haven't been able to find anything that could work. So im working on this memory type game where I have 9 buttons at the bottom and 66 cards on top.
What I want do is make the game work in the following way. You first select one of the buttons from the bottom. Then you start opening cards from the top. Only 6 will match the one at the bottom. Now, what could be the easiest way of making this work. I tried working my way through a memory game fla but it just doesnt' work.
Any ideas???
View Replies !
View Related
Card Flip Back Delay, Concentration Game
Hello all. I'm fairly new to Actionscripting and am using CS3. I just wrote a concentration game following a lynda.com tutorial. I want there to be a delay before two non matching flip cards flip back over. You probably know this, but a goToAndPlay("flipBack") is in the code. Here's what I think is the applicable snippet.
else
{
_firstCard.gotoAndPlay("flipBack");
event.currentTarget.gotoAndPlay("flipBack");
...
}
I will be applying the delay to both card flipping instances.
View Replies !
View Related
E-card
Can someone tell me how to create e-cards in flash or is there something like a tutorial somewhere?
I want everybody to be able to use my e-card(s). Each person will personalise his e-card with his own text...
Thnx...
View Replies !
View Related
E-card And ASP
I made changes on e-card tutorial which was writing in Cold Fusion to ASP and for some reason it send the email but the link on the email is not showing the e-card, here's the link...
http://www.nodoubtdesign.com/e-card.swf
Please let me know what's wrong with it
Thanks,
Sonic
View Replies !
View Related
E-card
I'm trying to make an e-card. I can make the movie, but don't know how to make it so that someone can e-mail it to another person, with some info in the body of the e-mail...Is this really easy, or am I going beyond Flash's capabilities?
View Replies !
View Related
E-card
Dear all,
is it somebody known how to do the flash e-card with asp server,
i am non-programming base flash user, need help, urgent.
jeand
View Replies !
View Related
E-card
Is it possible to do in Flash MX/asp an e-card set up where people can choose a picture then fill in their details etc and then that picture/animation be sent to an email address that they enter?
If so, how?
Cheers
View Replies !
View Related
|