Hello, I am creating a card game called Tarneeb which eqaully splits a deck of 52 cards amongst 4 different players so that each player has 13 cards. In doing so, each player can look at their cards and place a bid on how many times they will win. It ranges from 7 to 13 and there is a pass which means they would not like to bid. I am struggling to make the bidding system. Any help would be amazing.
#๐ Bidding System In Card Game
53 messages ยท Page 1 of 1 (latest)
@raw swift
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Closes after a period of inactivity, or when you send !close.
I am also trying to make it so each players bid will be like this [pass, 9, 10, 13] where index 0 represents player 1 etc. I am using pygame for this game. I will attach my code below.
sounds a lot like bridge ๐
it is to a degree haha
what's the problem? (I haven't looked at the code, and don't intend to until I better understand your problem)
ive attached a simplified version in the description
but to further extend
i created a method called getBid()
which I tried to make so it does what i described above
however
I'm not following your explanation
wdum sorry?
I don't understand you
which part do u not understand?
any of it
I don't understand your problem, and I haven't even looked at the code because it's enormously complex
if you cannot clearly describe your probem, I can't help you
my problem is that my getBid is not working with is my method to get different bids from the players. The reason it is not working is because instead of it printing what i want such as [pass, 13, 7, 8] as an example, it instead prints out the same number i click on and not in the position it is mean to. eg. [0, 0, 10, 0] whereas 10 needs to be in the first index since it is player 1 who startted the bid
have a look at my code 90% of it is independent of my getBid method anyways
which part i can explain it
why would bid.draw(screen): ever return False?
it wouldnt
then why do you have an if that checks?
but i use it so that it can check if the number button has been clicked
I didn't understand that at all
.draw() is part of my button code which i also sent
oh, it can return False
part of why this is confusing is that you're mixing up UI stuff -- drawing things on the screen and observing the mouse -- with your logic about the game. You should keep them as separated as you can.
okay no worries
and I can't run your program to see, since I don't have the bitmaps
if I were you I'd write as much of the game as possible as a pure-python library that doesn't do any I/O -- including drawing -- at all.
Then write a program that combines that library with the UI stuff.
that way you can easily write tests for the library
ill take that on board for the next features i add
https://gitlab.com/offby1/bridge/-/tree/master?ref_type=heads is an example of such a library
for sure man ill take a look into it
I don't know about your game, but I found the logic of "who gets to call when" to be surprisingly complicated ๐
i havent necessarily created that at all
ive only define attributes and stuff for each player
my objective was to make it work all together after getBids is done
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.