The first time I wrote a game and the first time I wrote a game in Python, I decided to write a game in Russia and supported online combat!
The data structure andAlgorithmExperience in design is insufficient. At the same time, some simple TCP/IP data transmission mechanisms are used in the online combat process. Therefore, there must be many improvements.
SpecificCodeThe implementation and algorithm analysis process will be completed later (Python source code download is available below). Here we will accept bricks and eggs, and I hope to give more comments and suggestions!
The game is as follows:
=========== Nancy RIS documentation ================================
1. SRCSource codeInstall the pygame library.
2. The nancyterisdirectory is the compiled exe and you can run tetris.exe directly.
Nancy RIS description
---------------------------------------------------
1. standalone game-run tetris.exe directly
2. Online combat (only two players are supported)
2.1 run the command line parameters on the host:
Tetris.exe Server
2.2 run the command line parameters of adding the IP address of the host to another machine:
Tetris.exe 192.168.xx.xx
Operation instructions
--------------------------------------
----- Begin deformation ------
----- Rotate left ------
----- → Shift right ------
----- Begin acceleration ------
----- Space directly drops ------
----- Enter start again ------
--------------------------------------
Download the game source code and binary version:
Http://files.cnblogs.com/coderzh/NancyTetris.rar
The game UI library uses the famous pygame, and nancytetris has been established at pygame.org. Please stay tuned for version updates:
Http://www.pygame.org/project/825? Amp; release_id = 1421