Liberty BASIC Community Forum
« Card Game Contest! »

Welcome Guest. Please Login or Register.
Jun 25th, 2017, 12:24am


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1 2 3 4 5 6  Notify Send Topic Print
 veryhotthread  Author  Topic: Card Game Contest!  (Read 6672 times)
jaba
Senior Member
ImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 325
smiley Re: Card Game Contest!
« Reply #45 on: Aug 18th, 2011, 1:54pm »

on Aug 17th, 2011, 10:58pm, Janet wrote:
I had trouble with overlapping cards as well. I finally resorted to doing a full redraw of the playing card hand area each time a card is clicked.

Use boxfilled to cover up the entire playing area of the range of cards. It's not necessary to cover up the entire graphics box.

call DealCard again for the entire hand.
... undecided

Thanks, Janet. What a great discussion!
I take your solution to mean that if you clicked a card that you wanted to move to a different position (as I want to do), that you redraw the whole hand checking the x,y coords for each card with the coords for the clicked card being the new position.

As I read more of the posts after this one, it seems one could use the RemoveCard function to clear the hand from the table instead of the boxfilled method. Am I missing the point of the boxfill method?

As I understand it, if you place a card using the DealCard method, your background is saved so that later when you RemoveCard, the background once again appears. Is that how you see it?

jaba
User IP Logged

If I didn't first try it and get it wrong, I may never have figured out how to get it right.
jaba
Senior Member
ImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 325
smiley Re: Card Game Contest!
« Reply #46 on: Aug 18th, 2011, 2:16pm »

on Aug 18th, 2011, 05:07am, Alyce Watson wrote:
Jaba, I do not see a place in the code snippet where you set any card's blocked status so that it is "blocked". You must do this. The DLL does not do it.
...


Thanks for all the help, Alyce.

Actually, I did set each card to blocked status as I dealt the player's hand. After, I unblocked the topmost card - the 7th card dealt. But, it didn't seem to help or matter. I began to believe that all cards are set to block automatically by the dll (which on reflection is a stupid assumption). I thought this because of this statement in the qcard32.hlp file:
Quote:
...QCARD32.DLL uses a method of putting a block on all cards covered over by another card. This is your responsibility to maintain.

Still, later I tried to unblock a selected card. I wondered why it wasn't working like I expected. But, I think it actually was working properly. If I clicked an area of an exposed card that was covering part of the underneath card, in fact the underneath card was getting unblocked and was the one card that got re-positioned. If that makes sense, then I think it worked properly, but not in the way I needed.

Continuing on now...
jaba
User IP Logged

If I didn't first try it and get it wrong, I may never have figured out how to get it right.
Admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 14484
xx Re: Card Game Contest!
« Reply #47 on: Aug 18th, 2011, 2:28pm »

on Aug 18th, 2011, 1:54pm, jaba wrote:
As I read more of the posts after this one, it seems one could use the RemoveCard function to clear the hand from the table instead of the boxfilled method. Am I missing the point of the boxfill method?

As I understand it, if you place a card using the DealCard method, your background is saved so that later when you RemoveCard, the background once again appears. Is that how you see it?

jaba


The DLL keeps track of the 'table' under the card when it is dealt. If you remove a card that is below the card in question, you might find that a remnant of the underneath card shows up at odd times when you remove the upper card. That's the problem Janet ran into. If it doesn't happen in your game, then you needn't address it.

If it does happen, then do as I did in the newest demo. Remove the cards, draw a boxfilled, then redeal the cards.

To be clearer: you should always remove a card before redealing it. You might also want to erase the table with a boxfilled after removing a card, but before redealing it.


The DLL documentation coud be clearer, I agree. A card's "blocked" status is set to "false" or 0 by default. You must set it to "1" if your game logic requires this.

I don't believe your "hand" of cards needs to have any cards set to "blocked". All are available for play, are they not?

Did you read the newest tutorial and try the demo code? Perhaps you'll find what you need there. I hope so.

« Last Edit: Aug 18th, 2011, 2:30pm by Admin » User IP Logged

jaba
Senior Member
ImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 325
smiley Re: Card Game Contest!
« Reply #48 on: Aug 18th, 2011, 5:31pm »

Alyce said: Quote:
Did you read the newest tutorial and try the demo code? Perhaps you'll find what you need there. I hope so.


I'm reading through the posts and the demos. It looks like I'll find the answer - assuming I recognize it when I see it. undecided

Thanks for all the explanations and help.

jaba
User IP Logged

If I didn't first try it and get it wrong, I may never have figured out how to get it right.
Admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 14484
smiley Re: Card Game Contest!
« Reply #49 on: Aug 24th, 2011, 07:45am »

There's about a week left before the deadline.

I hope to see more entries. Please enter your program even if it is not complete!
User IP Logged

jaba
Senior Member
ImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 325
smiley Re: Card Game Contest!
« Reply #50 on: Aug 24th, 2011, 10:58am »

I'm thinking later on today I might clean up and post what I have so far for my Go Fish! card game. It's only a beginning, but maybe someone else may want to run with it. It could be a fun game. (tsh73, I understand there is a Russian version of this game. Interested?).

I find I'm having the most trouble understanding the logic and flow of the game, and keeping track of where in the arrays to find the card I want to check.

But, that's just a function of my PEA-SIZED brain!!!

As a result, I spend a lot of time trying different things, printing interim steps for checking, and then redoing the code if something works. That's a time consuming process - more time than is left in the month for me.

And then, I'm afraid that without the time limit of finishing the program, I may just give it up after the contest ends. That worries me because it is still a personal challenge that I'd like to meet.

But, it's been a fun ride so far...

jaba
User IP Logged

If I didn't first try it and get it wrong, I may never have figured out how to get it right.
Admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 14484
smiley Re: Card Game Contest!
« Reply #51 on: Aug 24th, 2011, 1:30pm »

That's great, jaba! I hope it comes together for you and that you finish it some day.

The logic behind games can get complicated, even for apparently simple games.

I look forward to seeing your entry.

Thanks!
User IP Logged

tsh73
Moderator
ImageImageImageImageImage


member is offline

Avatar

Anatoly (real name)


PM

Gender: Male
Posts: 1661
smiley Re: Card Game Contest!
« Reply #52 on: Aug 24th, 2011, 5:17pm »

Quote:
tsh73, I understand there is a Russian version of this game. Interested?

Jaba,
I'm not in card games much - so while I might even seen this game played, I am not sure (nor remember Russian name for it).

I am trying to program "Old maid" - we use to play it as children. Of course computer version will be just game of chance - how you meaningfully make computer "bluff" pretending it has (or hasn't) "old maid", and trick human player into picking exactly that card?
User IP Logged

The existence of bug reports means somebody is using the software and actually cares to report back to you that he is having a problem with it, instead of just deleting it from their hard disk.
(Janusz Marcin Gorycki)
jaba
Senior Member
ImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 325
smiley Re: Card Game Contest!
« Reply #53 on: Aug 24th, 2011, 7:08pm »

I've added my work in progress called Go Fish! See the contest page at LB wiki for link.

jaba
User IP Logged

If I didn't first try it and get it wrong, I may never have figured out how to get it right.
Admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 14484
smiley Re: Card Game Contest!
« Reply #54 on: Aug 25th, 2011, 05:14am »

Jaba, that's a great start!

One suggestion: set the graphics backgroundcolor to be the same as the fill color and your status text will not appear in a white box.

Your code is nicely commented so it is very easy to follow. I like it!
User IP Logged

jaba
Senior Member
ImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 325
smiley Re: Card Game Contest!
« Reply #55 on: Aug 27th, 2011, 9:06pm »

I've added a second draft of a work in progress called Go Fish! See the contest page at LB wiki for link. I've added a little more functionality to the program, but I still have questions.

If anyone cares to, could you review the second draft and maybe answer the following questions?

Questions of forum. These issues come about after the program enters the sub gofishMsg.
1) In the gofishMsg sub, why don't the cards in the pool hand remove properly; and why don't they redisplay properly? (The pool hand is the bone pile, the middle line of cards).
2) Why is the pool hand so slow to redeal?
3) The y1, y2, y3 variables are global but do not work right in the gofishMsg sub for placing the player's hand. Why not?
4) Why doesn't the flush command work after redealing the pool hand and the player's hand? (Why don't the graphics stick?)

Thanks,
jaba
User IP Logged

If I didn't first try it and get it wrong, I may never have figured out how to get it right.
jaba
Senior Member
ImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 325
smiley Re: Card Game Contest!
« Reply #56 on: Aug 31st, 2011, 6:49pm »

Didn't get GoFish! done. sad

So, this morning I made up a simple game just so I could contribute something, and keep up my interest in game and graphics programming. I think everything works, but there are not many features, and -- I'm pretty sure it will be a boring game to play.

But, that's ok. It was fun. And, I learned a great deal.

I'm still going to try to post the incomplete GoFish! before the deadline. It'll be ugly!

See Contest page for link to KenoCard.

Fun, fun, fun.

jaba
User IP Logged

If I didn't first try it and get it wrong, I may never have figured out how to get it right.
Rod
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Graphics = goosebumps!


PM

Gender: Male
Posts: 5312
smiley Re: Card Game Contest!
« Reply #57 on: Sep 1st, 2011, 06:42am »

Kinda in the same boat. I did get my card images into the .dll and wrote the basic minimum code to display the playing board. Thats as far as I got. May resurrect the project later and add the game rules.

http://gamebin.webs.com/Uno.zip
User IP Logged

jaba
Senior Member
ImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 325
smiley Re: Card Game Contest!
« Reply #58 on: Sep 1st, 2011, 4:29pm »

Well, I guess I got in too much of a hurry submitting my KenoCard game. Turns out it doesn't make correct matches. Back to the drawing board.

jaba
User IP Logged

If I didn't first try it and get it wrong, I may never have figured out how to get it right.
Admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 14484
smiley Re: Card Game Contest!
« Reply #59 on: Sep 9th, 2011, 07:34am »

Poll is closed. There is only one vote.

The people who entered the contest have indicated that they need more time to complete their programs. We're extending the deadline to December 1, 2011. At that time, the staff will select a winner.

This gives the current entrants time to do more work on their card games. It also gives others a chance to enter as well.

The current entries look wonderful, so we hope to see progress on these and some new contenders in the next couple of months.

Thanks to all who participated. Keep 'em coming!
User IP Logged

Pages: 1 2 3 4 5 6  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls