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:

    • 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:

    On some systems, qmake may be called qmake-qt4, and instead of make you will need to write gmake, nmake, mingw32-make, or something else like that.

    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.
    Well - thank you very much human! :-)

    (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).
    I have such counter arguments.

    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:

    All success! Thanks for the feedback and take care of your brain :-)

    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! :-)

    Also popular now: