Compare commits

..

No commits in common. "6de49449aefcdbdda6dd212912de9802eff1f65f" and "ce01edd830652ecca4cae9984a88c7cb4581feed" have entirely different histories.

4 changed files with 17 additions and 26 deletions

18
LICENSE
View File

@ -1,18 +0,0 @@
Copyright 2014-2019 Alex Yatskov
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,4 +1,4 @@
# Tetrys
# Tetrys #
Tetrys is a minimalist Tetris clone written in Python. It is cross-platform compatible and has basic gamepad support.
There is presently no way to configure what the buttons do; that is an exercise left to the reader.
@ -8,6 +8,15 @@ When running the application you can press the <kbd>N</kbd> key to start a new g
of the current piece, and <kbd>Space</kbd> drops it to the bottom of the well instantly. A small shadow tetrad at the
bottom of the well indicates where the current piece will fall.
Tetrys requires [Python](http://www.python.org/) and [pygame](http://www.pygame.org/).
## Requirements ##
![](img/tetrys.png)
* [Python 2.7](http://www.python.org/download/releases/2.7/)
* [pygame](http://www.pygame.org/)
## Screenshots ##
[![Game window](https://foosoft.net/projects/tetrys/img/tetrys-thumb.png)](https://foosoft.net/projects/tetrys/img/tetrys.png)
## License ##
MIT

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

View File

@ -35,8 +35,8 @@ class Tetrad:
layout = list()
mask = self.block_configs[self.config][1] >> (16 * self.rotation)
for bit in range(16):
position = bit % 4, bit // 4
for bit in xrange(16):
position = bit % 4, bit / 4
if mask & (1 << bit):
layout.append((self.position[0] + position[0], self.position[1] + position[1]))
@ -60,7 +60,7 @@ class Tetrad:
def centered(self, width):
return Tetrad((width // 2 - 2, 0), self.config, self.rotation)
return Tetrad((width / 2 - 2, 0), self.config, self.rotation)
@staticmethod
@ -113,8 +113,8 @@ class Board:
def render_blocks(self, surface):
for y in range(self.grid_dims[1]):
for x in range(self.grid_dims[0]):
for y in xrange(self.grid_dims[1]):
for x in xrange(self.grid_dims[0]):
self.render_block(surface, self.blocks[y][x], (x, y))