Hexagonal Tetris
It seems that this is becoming a habit - every six months I post some of my craft in opensource.
This time I present to the court and public pleasure a Tetris clone. Hexagonal .
The idea of the game, I think, is familiar to everyone. I tried to give her a delicious implementation. It:
This case is written in Qt, without dependencies on anything else. Must gather everywhere. I tested on Windows, Linux and FreeBSD; Qt from 4.4.1 (the oldest was not at hand) to the brand new 4.7.0.
I got it all, traditionally, on googlecode. There is also a static assembly for Windows that does not require anything to work (except for Windows -)).
The assembly and installation procedure on any UNIX-like systems is standard.
You will need Qt with the development part. And then take the source from the project site and collect:
The last step (install) is optional, the application can be run without installing. You can also remove (make uninstall).
Actually, those who just want to try this thing can start :-) Further information is for those who want to improve something.
All my opensource experience shows that I am not able to support packages for different distributions alone. Also, I know for certain that very initiative people from ArchLinux and AltLinux hang out on the hub - probably there are representatives of other distributions. I posted a bag on AUR , but if someone undertakes to support it, I will convey it with gratitude.
If someone is going to build packages - three requests.
Accepted and welcome! Simple things will be done quickly, complex things will be taken into account for the future. Write in comments and / or mail.
If someone speaks a certain language and wants to do localization - I am always in favor. Write! If you do not understand anything about Qt and its means of localization - it does not matter; write; localization is easy. None of the project participants will be forgotten!
I do not promise that I will gladly accept your code. If you find and fix minor bugs - please. But if you want to edit everything at all, then I may not agree to accept your changes to the project. The desire to redesign may arise for several reasons:
Fine crushing arose because I was doing this project in snippets of 15 minutes. Maintaining large pieces of code in this mode is simply impossible. In the near future, I am unlikely to change the style of work. Therefore, the finely dispersed design is convenient and attractive to me.
Not optimality. Sometimes (IMHO) it is more useful to maintain simplicity, even if at the cost of a small non-optimality.
Not academic.I understand that somewhere the state machine asks for, the State pattern and centralization of signal emission, somewhere the Mementor asks, somewhere non-constant iterators and direct access to properties (there are only two for the whole program, can cause a protest, but they are still yes, I repent) ... I agree that the code does not always look like the textbooks require. But I would not like to rush to the implementation of strict schemes. Let ordinary users first express their Wishlist; let it become clear in which direction all this should be developed, and even then one can take up orthodox coding.
I have nothing more to say, but perhaps you can satisfy your thirst for reading and tetris at the following links:
upd: cypok found a bug that creeps under Mac OS X. If you are a user of this OS, then you need to follow its recommendations .
The problem can be fixed in another way: by replacing ": /icon.xmp" with ": /about_icon.xmp".
upd2: Mezomish made a PPA for Ubunta . Thanks to him!
upd3: 12:20:23 MSD - 1000 downloads of the Windows build only and only from the project site! Habr - power! :-)
This time I present to the court and public pleasure a Tetris clone. Hexagonal .
The idea of the game, I think, is familiar to everyone. I tried to give her a delicious implementation. It:
- Predictable behavior of figures. Something like physics. For example, if you want to rotate a figure, and the wall interferes with it, then the figure will move. Within reasonable limits, of course.
- Skins
- Adjustable field size.
- Just tried to give this business a nice look.
This case is written in Qt, without dependencies on anything else. Must gather everywhere. I tested on Windows, Linux and FreeBSD; Qt from 4.4.1 (the oldest was not at hand) to the brand new 4.7.0.
I got it all, traditionally, on googlecode. There is also a static assembly for Windows that does not require anything to work (except for Windows -)).
The assembly and installation procedure on any UNIX-like systems is standard.
You will need Qt with the development part. And then take the source from the project site and collect:
- wget http://hexglass.googlecode.com/files/hexglass-1.0.0.tar.gz
- tar xzf hexglass-1.0.0.tar.gz
- cd hexglass-1.0.0
- qmake
- make
- sudo make install
The last step (install) is optional, the application can be run without installing. You can also remove (make uninstall).
Actually, those who just want to try this thing can start :-) Further information is for those who want to improve something.
What I expect from the community
(i) Preparing packages for different distributions
All my opensource experience shows that I am not able to support packages for different distributions alone. Also, I know for certain that very initiative people from ArchLinux and AltLinux hang out on the hub - probably there are representatives of other distributions. I posted a bag on AUR , but if someone undertakes to support it, I will convey it with gratitude.
If someone is going to build packages - three requests.
- Write to me if you want me to keep you updated. In addition, it would be useful to put links to packages on the project website.
- Unsubscribe here. Because now people will start asking for deb, rpm ...
- Report any difficulties.
(ii) Suggestions for design, skins, features, typos ...
Accepted and welcome! Simple things will be done quickly, complex things will be taken into account for the future. Write in comments and / or mail.
(iii) Localization
If someone speaks a certain language and wants to do localization - I am always in favor. Write! If you do not understand anything about Qt and its means of localization - it does not matter; write; localization is easy. None of the project participants will be forgotten!
What I do not recommend doing
I do not promise that I will gladly accept your code. If you find and fix minor bugs - please. But if you want to edit everything at all, then I may not agree to accept your changes to the project. The desire to redesign may arise for several reasons:
- class splitting may seem too small to someone,
- some nodes may not seem optimal enough (for example, drawing a glass),
- some elements may not seem quite academically fulfilled (for example, the management class of everything and everything).
Fine crushing arose because I was doing this project in snippets of 15 minutes. Maintaining large pieces of code in this mode is simply impossible. In the near future, I am unlikely to change the style of work. Therefore, the finely dispersed design is convenient and attractive to me.
Not optimality. Sometimes (IMHO) it is more useful to maintain simplicity, even if at the cost of a small non-optimality.
Not academic.I understand that somewhere the state machine asks for, the State pattern and centralization of signal emission, somewhere the Mementor asks, somewhere non-constant iterators and direct access to properties (there are only two for the whole program, can cause a protest, but they are still yes, I repent) ... I agree that the code does not always look like the textbooks require. But I would not like to rush to the implementation of strict schemes. Let ordinary users first express their Wishlist; let it become clear in which direction all this should be developed, and even then one can take up orthodox coding.
Are you still reading?
I have nothing more to say, but perhaps you can satisfy your thirst for reading and tetris at the following links:
- Tetris changes the brain with unknown consequences for intelligence http://www.membrana.ru/articles/health/2009/09/08/181600.html
- A similar project. It is fully functional, but has not been developing since 1993 with all that it implies. It does not seem to work under Windows. ftp://ibiblio.org/pub/Linux/games/arcade/tetris/cxhextris.tar.z
- Another analogue, but I did not run it. It is written in Python, but it requires so many things that I haven’t installed, that I decided not to clutter up the system. http://mjr.iki.fi/software/ghextris
- The program for Windows ... but it looks dumb :-) I have not tried to run it. http://members.chello.at/theodor.lauppert/games/hextrisw.htm
- Part of my project is a prototype written in Tcl / Tk http://hexglass.googlecode.com/svn/tags/hexglass-1.0.0/prototype/xTetris.tcl
- Do you know that Qt applications support the -style option? Try -style plastique or -style motif; try the values cde, windows, cleanlook ... Perhaps you will like some styles; but not everything can work for you (depends on the Qt build).
upd: cypok found a bug that creeps under Mac OS X. If you are a user of this OS, then you need to follow its recommendations .
The problem can be fixed in another way: by replacing ": /icon.xmp" with ": /about_icon.xmp".
upd2: Mezomish made a PPA for Ubunta . Thanks to him!
upd3: 12:20:23 MSD - 1000 downloads of the Windows build only and only from the project site! Habr - power! :-)