pygame is
Python
Simple DirectMedia Layer
 
 
pygame.org is
Site Swing

Python Minesweeper - 1.0

Kyle Marshall (captainmarshall1)

Tags:

Description

An aesthetically pleasing version of the classic MineSweeper Game. I have only tested this on Ubuntu, but I presume it works just as well on other operating systems. All graphics are primitively drawn. This is my first python mini-project, so let me know what you think! It took about two days after school to code, so it's fairly simple, but fun to play and helpful for beginners! Controls: Arrow keys change size of the mine field, and pressing 'R' or the button in the top right corner will start a new game.

Links

Home Page: http://www.pygame.org/
Source: http://www.filedropper.com/pythonminesweeper
Windows: http://www.filedropper.com/pythonminesweeper
Mac: http://www.filedropper.com/pythonminesweeper

Screenshot


click to view original size

Releases

Python Minesweeper - 1.0 - Dec 4, 2010

Comments

If you wish to leave a comment, please sign in first.

December 10, 2010 12:05pm - Robert Leachman - nickname: (quazar)
Found the answer, in another Minesweeper game so easy to test ha ha. http://pygame.org/project-minesweeper-1686-2930.html uses:

< if pygame.mouse.get_pressed()[0]:
> if event.button == 1:

and the important one, since if it's wonky people die:

< if pygame.mouse.get_pressed()[2]:
> if event.button == 3:

Works good here, how about you?
December 5, 2010 9:55pm - Kyle Marshall - nickname: (captainmarshall1)
Thank you very much for the positive feedback! Any thoughts on how to fix the right-clicking issue? And I also think I may add a small menu where you can change all the colors fit your needs :)
December 5, 2010 7:08pm - Robert Leachman - nickname: (quazar)
Good job! For my taste the playfield is too light but that's probably a personal problem. More interesting, on OS X the right-click isn't reliable... sometimes I mean to mark a spot and instead it's processed as a left click and I'm dead. I added a debugger line and it's not just me :)

$ diff python_minesweeper_dist.py python_minesweeper_hacked.py
186a187
> print "LEFT"
189a191
> print "RIGHT"
296c298
< pygame.draw.rect(screen, (215, 230, 225), (x*tilewidth+xoff, y*tilewidth+yoff, tilewidth-2,tilewidth-2))
---
> pygame.draw.rect(screen, (185, 170, 175), (x*tilewidth+xoff, y*tilewidth+yoff, tilewidth-2,tilewidth-2))
303c305
< pygame.draw.rect(screen, (215, 230, 225), (x*tilewidth+xoff, y*tilewidth+yoff, tilewidth-2,tilewidth-2))
---
> pygame.draw.rect(screen, (185, 170, 175), (x*tilewidth+xoff, y*tilewidth+yoff, tilewidth-2,tilewidth-2))

Otherwise yeah impressive stuff!
spotlight

 
our projects
pygame.org welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
 
recent releases
Feb 13, 2012

Jul 5, 2011

Apr 17, 2011

Apr 16, 2011

Apr 15, 2011


Apr 14, 2011



Apr 12, 2011

Apr 11, 2011


... more!
 
for pygame related questions, comments, and suggestions, please see help (lists, irc)