Compare commits
11 Commits
0e68ea4e51
...
0.1
Author | SHA1 | Date | |
---|---|---|---|
abaeb3be9a | |||
dff4ae487a | |||
5c830fd828 | |||
a46c07af8b | |||
338371f443 | |||
a95463438e | |||
06fe72d8db | |||
4a69c12349 | |||
2bd75be892 | |||
3015a36984 | |||
7fc342e061 |
@ -2,9 +2,11 @@
|
||||
|
||||
Tetris clone made with Python and Arcade graphic library
|
||||
|
||||

|
||||
|
||||
## Requirements
|
||||
|
||||
* [Python](https://www.python.org/)
|
||||
* [Python](https://www.python.org/) 3.6 or upper
|
||||
|
||||
## Install
|
||||
|
||||
@ -31,5 +33,5 @@ Use key name from [arcade.key package](http://arcade.academy/arcade.key.html).
|
||||
|
||||
```shell
|
||||
python -m pip install -r build-requirements.txt
|
||||
python setup.py build
|
||||
```
|
||||
python setup.py bdist
|
||||
```
|
||||
|
@ -4,10 +4,7 @@ import locale
|
||||
import time
|
||||
import os
|
||||
|
||||
try:
|
||||
import configparser
|
||||
except ImportError:
|
||||
import ConfigParser as configparser
|
||||
import configparser
|
||||
|
||||
try:
|
||||
import arcade
|
||||
@ -95,6 +92,7 @@ class MinoSprite(arcade.Sprite):
|
||||
self.set_texture(0)
|
||||
|
||||
def refresh(self, x, y, prelocked=False):
|
||||
self.scale = self.window.scale
|
||||
size = MINO_SIZE * self.scale
|
||||
self.left = self.window.matrix_bg.left + x * size
|
||||
self.bottom = self.window.matrix_bg.bottom + y * size
|
||||
@ -203,6 +201,8 @@ class TetrArcade(TetrisLogic, arcade.Window):
|
||||
self.init_height = int(self.conf["WINDOW"]["height"])
|
||||
self.init_fullscreen = self.conf["WINDOW"].getboolean("fullscreen")
|
||||
|
||||
for action, key in self.conf["KEYBOARD"].items():
|
||||
self.conf["KEYBOARD"][action] = key.upper()
|
||||
self.key_map = {
|
||||
State.STARTING: {
|
||||
getattr(arcade.key, self.conf["KEYBOARD"]["start"]): self.new_game,
|
||||
@ -480,8 +480,11 @@ High score could not be saved:
|
||||
|
||||
|
||||
def main():
|
||||
TetrArcade()
|
||||
arcade.run()
|
||||
try:
|
||||
TetrArcade()
|
||||
arcade.run()
|
||||
except Exception as e:
|
||||
sys.exit(e)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@ -1 +1 @@
|
||||
cx-freeze
|
||||
arcade cx-freeze
|
45
setup.py
45
setup.py
@ -9,18 +9,35 @@ else:
|
||||
base = None
|
||||
icon = None
|
||||
|
||||
setup(
|
||||
name="TetrArcade",
|
||||
version="0.1",
|
||||
description="Tetris clone",
|
||||
author="adrienmalin",
|
||||
executables=[Executable(script="TetrArcade.py", icon=icon, base=base)],
|
||||
options={
|
||||
"build_exe": {
|
||||
"packages": ["arcade", "pyglet"],
|
||||
"excludes": ["tkinter", "PyQt4", "PyQt5", "PySide", "PySide2"],
|
||||
"include_files": "res",
|
||||
"silent": True,
|
||||
}
|
||||
},
|
||||
excludes = [
|
||||
"tkinter",
|
||||
"PyQt4",
|
||||
"PyQt5",
|
||||
"PySide",
|
||||
"PySide2"
|
||||
]
|
||||
|
||||
executable = Executable(
|
||||
script = "TetrArcade.py",
|
||||
icon = icon,
|
||||
base = base,
|
||||
shortcutName="TetrArcade",
|
||||
shortcutDir="DesktopFolder"
|
||||
)
|
||||
|
||||
options = {
|
||||
"build_exe": {
|
||||
"packages": ["arcade", "pyglet"],
|
||||
"excludes": excludes,
|
||||
"include_files": "res",
|
||||
"silent": True
|
||||
}
|
||||
}
|
||||
setup(
|
||||
name = "TetrArcade",
|
||||
version = "0.1",
|
||||
description = "Tetris clone",
|
||||
author = "AdrienMalin",
|
||||
executables = [executable],
|
||||
options = options,
|
||||
)
|
||||
|
Reference in New Issue
Block a user