It is currently Tue Jul 17, 2018 10:45 am

 All times are UTC - 7 hours

 Page 1 of 1 [ 1 post ]
 Print view Previous topic | Next topic
Author Message
 Post subject: card games, keeping track of the cards.Posted: Sat Aug 25, 2007 1:17 am

Joined: Sat Oct 02, 2004 12:07 pm
Posts: 163
I have been attempting to write a card game for the nes, and have been having quite the time figuring out a system of keeping the cards in order between two players. i think i have finally found a system that works for this game, though i would like to get some criticism and suggestions if possible. first of, i should state this game is a game of war.

basically, when the game starts out, it generates a deck of cards in random order based off the time it took the player to start the game from the title screen. this deck will then be divided and put in to two stacks of sorts, one for player 1 and one for player 2. and two variables indicating the card counts for both players will be set to 26.

when the players flip out their cards, the first card in the stack will be written to a variable, and the remaining cards still in the stack will be shifted one to the left... the cards will be compared and who ever has the higher card will have both cards added to the right side of the stack (end) and the card counts adjusted accordingly.

if the players both have the same card, and war occurs. both cards will be added to another stack for the waring cards. and a war card count will be created. then four cards will be pulled from each player, the fourth being saved in the current card variables, and all four cards from both players added to the end of the war card array. if players get the same cards this time, war will repeat adding on to the war array. once a player wins, all these cards will be added to the end of the winners stack, card counts will be adjusted.

that is what i am currently thinking is going to work, it is simple and easy to use. before when trying to figure out the best way to manage the cards, i kept making it to complicated and running in to problems, only to create a new problem after fixing each problem before it.

what i would like to see, is suggestions or other ways to keep track of these cards.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 1 post ]

 All times are UTC - 7 hours

#### Who is online

Users browsing this forum: dougeff, lidnariq and 3 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ NES / Famicom    NESdev    NESemdev    NES Graphics    NES Music    Homebrew Projects       2018 NESdev Competition       2017 NESdev Competition       2016 NESdev Competition       2014 NESdev Competition       2011 NESdev Competition    Newbie Help Center    NES Hardware and Flash Equipment       Reproduction    NESdev International       FCdev       NESdev China       NESdev Middle East Other    General Stuff    Membler Industries    Other Retro Dev       SNESdev       GBDev    Test Forum Site Issues    phpBB Issues    Web Issues    nesdevWiki