Page 1 of 2

Tetris Partner

PostPosted: Thu Aug 18, 2011 12:44 am
by tintran
  • Use A,S,D,W(Player 1) and Arrow Keys(Player 2).
  • Play with a partner or play alone by using both hands on the keyboard.
  • No sound.
Beware:
If you drop your piece on your partner's piece or if your partner's piece drops on your piece, it'll stay stationary just like as if you would drop a piece on bottom of playing field, so stay out of each other's way is a good idea.

Also if you play too fast compared to your partner and you build up your side of the board you'll have less room/time to maneuver your piece so try and stay somewhat in synch.

Pieces will drop faster as you and your partner destroy rows, Tetrises are encouraged because the timer will decrease the same amount each time a row (2,3, or 4 rows(tetris)) is destroyed meaning the timer will decrease by 10ms for a single row and will also decrease by 10ms for a Tetris (4 rows destroyed at once).
post #6 below has joystick support for player1 on Wine/Windows. :arrow: Follow my the link in my signature, it has the latest Windows executable which changes background music and background image.

Re: Tetris Partner

PostPosted: Thu Aug 18, 2011 1:19 pm
by Turon
Looks good! Love the Graphics! :D The Original did not have those graphics.

Re: Tetris Partner

PostPosted: Thu Aug 18, 2011 4:30 pm
by SuperSonic
Wow, this is amazing :shock:

Tetris is one of my favorite games :D

Re: Tetris Partner

PostPosted: Thu Aug 18, 2011 9:36 pm
by tintran
:) someone likes it.

Re: Tetris Partner

PostPosted: Thu Aug 18, 2011 10:10 pm
by SuperSonic
Correction, someone loves it! :lol:

Re: Tetris Partner

PostPosted: Sat Aug 20, 2011 6:29 am
by tintran
Added functionality
  • controls:
    • KEY_2 (above KEY_w)rotates Player 1's piece in counter-clockwise direction
    • KEY_END (above the KEY_UP) rotates Player 2's piece in coutner-clockwise direction
    • Joystick1 support for Player 1 (see attached img for details)
      holding down keys will repeat but not out of control fast(this was the main reason why i disabled the repeat keys on the first post) (done by timer variables in scripts) and holding rotate keys/buttons will also repeat but only as 1/2 speed as move keys
  • graphics:
    • blocks get tossed up a little and then drop as they fade out when lines get destroyed (see attached img).
    • Play and End (triangular buttons) fade out so they don't hurt the eyes and become less distracting to players.
I really wanted to get the second controller to work for Player 2 but there is no GetJoystick2Axis() or GetJoystick2Button() (does anyone know :?: )
joystick works great when GE runs in Wine (so I am guessing it should work for Windows. Linux version seems to not know anything about joystick eventhough 'jstest /dev/input/js0' and jstest /dev/input/js1' works, the code runs with no errors but it joystick don't seem to have any effect under Linux(Fedora)

Re: Tetris Partner

PostPosted: Sun Aug 21, 2011 2:52 am
by Jagmaster
Awesome! :mrgreen:

Re: Tetris Partner

PostPosted: Sun Aug 21, 2011 4:24 am
by tintran
Thanks, i am trying to see if i can get both joysticks going for Linux.

Re: Tetris Partner

PostPosted: Mon Aug 22, 2011 12:49 am
by Clokio
tintran that a great idea 2 players, wow.

Re: Tetris Partner

PostPosted: Tue Aug 23, 2011 5:50 am
by tintran
Turon wrote:Looks good! Love the Graphics! :D The Original did not have those graphics.

added motion blur.

Re: Tetris Partner

PostPosted: Tue Aug 23, 2011 12:39 pm
by Jagmaster
That motion blur is awesome! I am baffled by how you did all of this. :o

Re: Tetris Partner

PostPosted: Tue Aug 23, 2011 8:34 pm
by tintran
not sure which part baffles you :)
but the motion blur was done in Gimp,
  • Layer->Transform->Arbitrary Rotation (with 45) enter in the X,Y for my center
  • Layer->Layer to image size (this step is needed so that i can specify the same center X,Y again for the next step)
  • Filter->Motion Blur-> Radial (enter same X,Y) as step 1 for blur center and 90 for angle.

Re: Tetris Partner

PostPosted: Wed Aug 24, 2011 3:47 am
by tintran
Added joystick support for Linux for player 1 and 2.
run joystickLinux.sh before or after starting the game.
and next piece's color preview.
(sorry about that 1 download, i forgot to uncomment some test code and so rows didn't get destroyed).
TetrisPartner.zip
(1.54 MiB) Downloaded 385 times


single player Tetris (arrow keys and 'end' key to rotate counter clockwise, use Tetris.ged instead of TetrisPartner.ged)
tetris.jpg
Tetris.zip
(1.46 MiB) Downloaded 374 times

Re: Tetris Partner

PostPosted: Sun Jan 15, 2012 11:19 pm
by lcl
This is amazing!
I HAD to bump this because it hasn't gotten the attention it deserves!

This game is done in very good way.
It runs smoothly though it it uses canvas. That's a great example of how to use it efficiently.
The gameplay is also done very nicely and effects are cool, too!

I managed to find one bug that I could report.
See this picture, it explains quite well:
Image

Still great work tintran! :)

Re: Tetris Partner

PostPosted: Mon Jan 16, 2012 12:17 am
by tintran
If i make it so it pushes the other player's piece down that would be buggy too since it would seem odd that one player's control affect the other player's piece.
If i make it so it so it continues to drop when the space below is freed up it would violate the rule of stopping when no free space is available.

I don't know if it's a bug or a feature.
That happens when two players get in each other's way. Think of it as a penalty for being too risky! :)

note: it uses canvas to draw the pieces, all the motion blur for dropping and rotation is done using actors.