Compare commits

...

10 Commits

Author SHA1 Message Date
6de49449ae Update README 2022-07-14 14:22:21 -07:00
42a84bce44 Add site metadata 2021-12-14 19:44:54 -08:00
7a522dde53 Update README 2021-06-08 22:46:06 -07:00
9cfcddad52 Update for Python3 2020-04-28 22:52:05 -07:00
1c7bb3dc45 Updating README.md 2019-04-28 16:02:45 -07:00
ef266c75db Updating README.md 2019-04-28 12:34:23 -07:00
211639c073 update license file 2019-04-28 11:52:53 -07:00
0be1783252 Updating README.md 2017-07-30 17:37:48 -07:00
9ca2d00c77 Updating README.md 2016-09-06 21:16:31 -07:00
07639e8c3f Updating README.md 2016-09-06 21:14:11 -07:00
4 changed files with 26 additions and 17 deletions

18
LICENSE Normal file
View File

@ -0,0 +1,18 @@
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,15 +8,6 @@ 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.
## Requirements ##
Tetrys requires [Python](http://www.python.org/) and [pygame](http://www.pygame.org/).
* [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
![](img/tetrys.png)

BIN
img/tetrys.png Normal file

Binary file not shown.

After

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 xrange(16):
position = bit % 4, bit / 4
for bit in range(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 xrange(self.grid_dims[1]):
for x in xrange(self.grid_dims[0]):
for y in range(self.grid_dims[1]):
for x in range(self.grid_dims[0]):
self.render_block(surface, self.blocks[y][x], (x, y))