Games [XUI2D] Tetris

Discussion in 'Game Development' started by Erel, Jul 16, 2019.

  1. Erel

    Erel Administrator Staff Member Licensed User


    I've ported the old Tetris example ( to X2 framework.

    It is part of the examples pack.

    This game is different than other games as there is nothing physical in this game.
    Each "piece" is made of 4 blocks. Each block is a body by itself. There is always one moving piece.
    The size of each block is 1 x 1 meters.
    The world size is set in such way that the number of pixels (scaled pixels actually) per 1 meter is a whole number. This is important to avoid drawing issues.

    The user input is checked every set interval (IntervalBetweenUserInputMs).
    The bodies are moved in a non-physical way using SetTransform.

    The main difference compared to the old example is that we don't need to manage the elements positions ourselves. It is done by the X2 framework.
    MarcoRome, hibrid0, Jack Cole and 8 others like this.
  2. Erel

    Erel Administrator Staff Member Licensed User

    I've uploaded a new version. There was a bug in with the drawing of the next piece (also visible in the above gif). The piece was flipped.
    JakeBullet70 and inakigarm like this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice