Simple games created with the pygame module
danielchang2002 / pygame Goto Github PK
View Code? Open in Web Editor NEWSimple games created with Pygame
Simple games created with Pygame
Hi m8 thanks a lot for the code and the video I would like to make your minesweeper a little more like the classic windows version (adding a menu, countdown, reset button etc)
The think is that I think I can code the logic for that but I am terrible at pygame :P
I a struggling to find a way to add some real estate on the window (to add the reset button counter etc) without needing to rewrite the code you made...
to put it simply
Now it looks like this:
https://i.imgur.com/OPKC91A.png
I need it to look like this:
https://i.imgur.com/iS2zMA9.png
Why am I asking for help since in the 2ns screenshot it seems that I have done it?
Well it was just a trick it doesnt work (I just added +100 on self.sizeScreen[1] on line 19
and also set topleft (0, 100) instead of (0.0) on line 54.
but that just messes up with the way it handle flags/clicks
def handleClick(self, position, flag):
index = tuple(int(pos // size) for pos, size in zip(position, self.pieceSize))[::-1]
self.board.handleClick(self.board.getPiece(index), flag)
in particular essentially as far as mouseclicks go the board hasnt change position so if I click on the 1,1 square(of the 2nd screenshot) the 2,1 square gets clicks
and I cant figure a way to just make a window that's slightly bigger than a given matrix :/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.