It is currently Tue Apr 07, 2020 7:11 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: Computer Card Games
PostPosted: Thu Jan 05, 2012 10:59 pm 
Offline
MCGI Member

Joined: Tue Aug 17, 2010 4:42 am
Posts: 438
I found out what's going on that I have to fix, for some reason when the deck reaches zero and the stack of collected cards is copied over to the deck it adds a sixth card to the player hand when there's only supposed to be 5 cards in the players hand...

should be an easy fix.


Top
 Profile  
 
 Post subject: Re: Computer Card Games
PostPosted: Thu Jan 05, 2012 11:10 pm 
Offline
MCGI Member

Joined: Tue Aug 17, 2010 4:42 am
Posts: 438
And of course I fixed it like ten seconds after that post...

Now I have no bugs to work out... just more functionality to add...

What happens when @ war.
What happens when Comp plays first.
Graphics and Animation.

Here's a screen shot of what it looks like as of right now...

Attachment:
Screen shot 2012-01-05 at 9.09.46 PM.png
Screen shot 2012-01-05 at 9.09.46 PM.png [ 330.86 KiB | Viewed 1706 times ]


Top
 Profile  
 
 Post subject: Re: Computer Card Games
PostPosted: Thu Jan 05, 2012 11:12 pm 
Offline
MCGI Member

Joined: Tue Aug 17, 2010 4:42 am
Posts: 438
And I just realized that the card order that came up in that shuffle is a palindrome... hehe


Top
 Profile  
 
 Post subject: Re: Computer Card Games
PostPosted: Fri Jan 06, 2012 6:59 pm 
Offline
MCGI Member

Joined: Tue Aug 17, 2010 4:42 am
Posts: 438
I got the WAR function working and added in some timers so the cards don't vanish right away.

I still need to do what happens when the computer plays first and all that turn based stuff and add some graphical elements, but it won't take too long.


Top
 Profile  
 
 Post subject: Re: Computer Card Games
PostPosted: Sat Jan 07, 2012 12:30 am 
Offline
MCGI Member

Joined: Tue Aug 17, 2010 4:42 am
Posts: 438
I found another problem that should be an easy fix... when you play through the game it has a hiccup when there's no more cards to replace what you play from your hand.

I just need to tell it that if there are no more cards that it should just finish off what's in the hand and then declare a champion if it get's down to nothing.

My animations are coming in good too... it flashes a banner "You Win" if you win a round, "You Lose" if you lose a round, "WAR!!!" if you go to war...

Gonna make it say something if you win the game or lose the game.


Top
 Profile  
 
 Post subject: Re: Computer Card Games
PostPosted: Sat Jan 07, 2012 5:26 am 
Offline
MCGI Member

Joined: Tue Aug 17, 2010 4:42 am
Posts: 438
Right now my debugging process consists of playing game after game of WAR until the thing returns an error...

The current errors are happening only when you play the entire deck, so I have to play entire games of WAR until I either win it or lose it to see if my fixes are working.


Top
 Profile  
 
 Post subject: Re: Computer Card Games
PostPosted: Sat Jan 07, 2012 10:47 pm 
Offline
MCGI Member

Joined: Tue Aug 17, 2010 4:42 am
Posts: 438
Lame ass bug keeps popping up and not going away, I think I might start over from scratch on this project, I think my bug is coming from poor coding early on in the design phase.

It's a learning project anyway so I'm not concerned about starting over or anything.

Plus all this code can be reworked into it in one form or another anyway.

I'm going to get out the old pen and paper and make some plans for it.


Top
 Profile  
 
 Post subject: Re: Computer Card Games
PostPosted: Sun Jan 08, 2012 4:43 am 
Offline
MCGI Member

Joined: Tue Aug 17, 2010 4:42 am
Posts: 438
I've started coding my War game nearly from scratch.

I'm reducing the amount of code needed for things, and making it easier to debug.

At the same time I'm incorporating graphics and animations as I go... I realized that it's important to make sure everything I need to work starts working from the get go... as in, get all the features I want active as I go.

So right now when you start the game it shuffles the cards, and deals them, you see them dealt.
Then it puts them into the initial starting hands.
Instead of making the game work from one side like I was before, my next step will be making the turn based system.

I'm trying to figure out a way to reduce the code for the computer decision making process... right now with my first version it's several thousand lines of code.

I think the solution will be assigning numerical values to all the cards...

all 2's are worth 2... 3's are worth 3... etc...

That way I can reduce the decision making down to a switch statement with about 13 or so cases rather than a big assed jumble of if statements.


Top
 Profile  
 
 Post subject: Re: Computer Card Games
PostPosted: Tue Jan 17, 2012 4:50 pm 
Offline

Joined: Thu Oct 28, 2010 8:25 am
Posts: 89
Last time I coded something was to many years ago... Good times! Today, I believe I forgot everything about coding. The server and services management is my current work. :)


Top
 Profile  
 
 Post subject: Re: Computer Card Games
PostPosted: Tue Jan 17, 2012 5:41 pm 
Offline
MCGI Member

Joined: Tue Aug 17, 2010 4:42 am
Posts: 438
cool.

I like coding.

I'm still learning though, so I keep going back and checking through stuff I've already done, trying to find ways to reduce it down to small little snips instead of thousands and thousands of lines.

So far I've managed to take a section of code that was about 500 lines and do the same exact thing in 5 lines... IMO I'd rather have the 5 lines... probably runs 10X faster that way.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 1 guest


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

Search for:
Jump to:  
cron
© 2008 phpbbstylists.com
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group