Pyhole - 1.0
Pyhole is my version of the card-game "Asshole", also known as "Presidents and Assholes".
This is a simple 'point and click card' game; no draggin' and droppin'.
The game of "Asshole" is pretty simple. The entire deck is split up between the number of people playing and the person with the 3 of clubs starts off. (There is also a version where you can have doubles, triples, and even quadruples but this proved quite impossible as you'll see and I left it as just singles) For the card in the middle, the only card you can put down is a card of the same number or a card of the same suit that is higher. If your card goes all the way around back to you and no one else has put a card down, the deck clears and you can put down whatever you want. Also, the two's clear the deck and you can then put down whatever you want...use them wisely.
The last one to get rid of all of their cards is the asshole. I used to play this with my friends at lunch to see who would take out all of the trash.
All credit for the card images goes to their authors Jesse Fuchs and Tom Hart of the The SVG Deck at http://freeware.esoterica.free.fr/html/freecards.html.
A few notes:
If you want to use a 'two', click on the "PYHOLE" text at the top of the screen. If you want to skip to the next player, and believe me, you're going to have to to finish the game, click in the middle of the screen where the middlecard blits.
It is best to select your card by the left side as this will highlight it everytime, but not if you can't use that card.
Also, if for some reason the 'player' uses all of his or her cards and isn't in the the 'winners' list in the background python screen, click on the "YOU" text below your cards and this will automatically put you in there.
For those who look, this code is attrocious. I am well aware of its ridiculousness; but if you still feel like telling me, go ahead. I just ask that if you know anything that could help it, or me, in any way, please tell me. I'm still learning and would gladly except any criticism no matter how insultingly true it may be.
It is written in python 3.1. You will have to download a .zip file. I use a windows but I don't think there should be any problems using something else.
Pygame.org account Comments
josmiley 2011-09-03 22:51:05
Traceback (most recent call last):
File "Pyhole.py", line 6454, in <module>
backofcardhl = pygame.image.load('backofcardhl.png')
pygame.error: Couldn't open backofcardhl.png
Joshua Powell 2011-09-04 00:31:59
Sorry about that. I thought I was sure I had all of the card images copied into the .zip. But if you want, you can just erase that line or put a # sign in front of it to keep the error from popping up. I must've missed that while looking over and cleaning up the code. That originally was for the purpose of testing out my function for 'clicking and highlighting' objects. Again, I'm sorry about that.
steffen5730 2011-10-04 11:41:57
# before line: 6454 and it works!
Bemoniri 2012-01-11 14:37:01
Hi, Actually very good but:
Why did print all the mouse coordinates?
I think it was actually worthless ...
seo 2020-05-17 16:18:24.400636Pretty good post. I have just stumbled upon your blog and enjoyed reading your blog posts very much. I am looking for new posts to get more precious info. Big thanks for the useful info. เว็บดูหนังออนไลน์