11 Commits

Author SHA1 Message Date
abaeb3be9a v0.1 release 2019-10-02 23:14:41 +02:00
dff4ae487a setup.py 2019-10-02 17:19:11 +02:00
5c830fd828 update setup.py info 2019-10-02 16:44:25 +02:00
a46c07af8b add start menu shortcut for windows installer 2019-10-02 16:39:37 +02:00
338371f443 fix resize error since texture use 2019-10-02 16:37:39 +02:00
a95463438e Add screenshot 2019-10-02 16:22:16 +02:00
06fe72d8db Merge branch 'master' of https://git.malingrey.fr/adrien/TetrArcade 2019-10-02 15:44:02 +02:00
4a69c12349 no python2 2019-10-02 14:51:56 +02:00
2bd75be892 Arcade require Python 3.6+ 2019-10-02 13:07:30 +02:00
3015a36984 case insensitive keyboard conf 2019-10-02 12:36:03 +02:00
7fc342e061 V0.2-dev 2019-10-02 12:35:35 +02:00
4 changed files with 46 additions and 24 deletions

View File

@ -2,9 +2,11 @@
Tetris clone made with Python and Arcade graphic library Tetris clone made with Python and Arcade graphic library
![Screenshot](https://malingrey.fr/images/fMd4EseZ/VtwJIMyQ.png)
## Requirements ## Requirements
* [Python](https://www.python.org/) * [Python](https://www.python.org/) 3.6 or upper
## Install ## Install
@ -31,5 +33,5 @@ Use key name from [arcade.key package](http://arcade.academy/arcade.key.html).
```shell ```shell
python -m pip install -r build-requirements.txt python -m pip install -r build-requirements.txt
python setup.py build python setup.py bdist
``` ```

View File

@ -4,10 +4,7 @@ import locale
import time import time
import os import os
try: import configparser
import configparser
except ImportError:
import ConfigParser as configparser
try: try:
import arcade import arcade
@ -95,6 +92,7 @@ class MinoSprite(arcade.Sprite):
self.set_texture(0) self.set_texture(0)
def refresh(self, x, y, prelocked=False): def refresh(self, x, y, prelocked=False):
self.scale = self.window.scale
size = MINO_SIZE * self.scale size = MINO_SIZE * self.scale
self.left = self.window.matrix_bg.left + x * size self.left = self.window.matrix_bg.left + x * size
self.bottom = self.window.matrix_bg.bottom + y * 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_height = int(self.conf["WINDOW"]["height"])
self.init_fullscreen = self.conf["WINDOW"].getboolean("fullscreen") 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 = { self.key_map = {
State.STARTING: { State.STARTING: {
getattr(arcade.key, self.conf["KEYBOARD"]["start"]): self.new_game, getattr(arcade.key, self.conf["KEYBOARD"]["start"]): self.new_game,
@ -480,8 +480,11 @@ High score could not be saved:
def main(): def main():
TetrArcade() try:
arcade.run() TetrArcade()
arcade.run()
except Exception as e:
sys.exit(e)
if __name__ == "__main__": if __name__ == "__main__":

View File

@ -1 +1 @@
cx-freeze arcade cx-freeze

View File

@ -9,18 +9,35 @@ else:
base = None base = None
icon = None icon = None
setup( excludes = [
name="TetrArcade", "tkinter",
version="0.1", "PyQt4",
description="Tetris clone", "PyQt5",
author="adrienmalin", "PySide",
executables=[Executable(script="TetrArcade.py", icon=icon, base=base)], "PySide2"
options={ ]
"build_exe": {
"packages": ["arcade", "pyglet"], executable = Executable(
"excludes": ["tkinter", "PyQt4", "PyQt5", "PySide", "PySide2"], script = "TetrArcade.py",
"include_files": "res", icon = icon,
"silent": True, 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,
) )