Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
236 changes: 232 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,236 @@
__pycache__/
*.py[cod]
*$py.class
.DS_Store
_*.mp4
_*.gif
cydoomgeneric/
temp_audio.mp3
temp_audio.mp3

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# SonarLint plugin
.idea/sonarlint/

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
47 changes: 22 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,33 @@ Pour des raisons matérielles, la croix gère deux modes de couleur :

## Liste des modules

- Exemple - [example.py](example.py)
- Exemple - [example.py](src/croix_pharmacie/mains/example.py)
- Affichage d'une vidéo avec le son - [videoplayer.py](videoplayer.py)
- Jeu pong imaginé par [le_egar](https://twitter.com/le_egar/status/1517539004627001346), avec 4 joueurs - [pong.py](pong.py)
- Doom (voir instructions ci-dessous) - [doom.py](doom.py)
- Simulation de chute de sable - [falling_sand_simulation.py](falling_sand_simulation.py)
- Simon says - [simon.py](simon.py)
- Snake - [snake.py](snake.py)
- Animation d'un cube rotatif - [cube.py](cube.py)
- Affichage de texte - [textwriter.py](textwriter.py)
- Effets visuels - [visual_effects.py](visual_effects.py)
- Spirale hypnotique - [youreundercontrol.py](youreundercontrol.py)
- Plasma - [plasma.py](plasma.py)
- Rotozoom - [rotozoom.py](rotozoom.py)

Pour installer les dépendances Python, exécutez la commande `pip install -r requirements.txt`
- Jeu pong imaginé par [le_egar](https://twitter.com/le_egar/status/1517539004627001346), avec 4 joueurs - [pong.py](src/croix_pharmacie/mains/pong.py)
- Doom (voir instructions ci-dessous) - [doom.py](src/croix_pharmacie/mains/doom.py)
- Simulation de chute de sable - [falling_sand_simulation.py](src/croix_pharmacie/mains/falling_sand_simulation.py)
- Simon says - [simon.py](src/croix_pharmacie/mains/simon.py)
- Snake - [snake.py](src/croix_pharmacie/mains/snake.py)
- Animation d'un cube rotatif - [cube.py](src/croix_pharmacie/mains/cube.py)
- Affichage de texte - [textwriter.py](src/croix_pharmacie/mains/textwriter.py)
- Effets visuels - [visual_effects.py](src/croix_pharmacie/mains/visual_effects.py)
- Spirale hypnotique - [youreundercontrol.py](src/croix_pharmacie/mains/youreundercontrol.py)
- Plasma - [plasma.py](src/croix_pharmacie/mains/plasma.py)
- Rotozoom - [rotozoom.py](src/croix_pharmacie/mains/rotozoom.py)

## Installation
Pour juste l'installer : `pip install git+https://github.com/MathisHammel/CroixPharmacie`
Si vous voulez faire des modifications `pip install --editable git+https://github.com/MathisHammel/CroixPharmacie`

Pour ajouter des features vous pouvez aussi installer [rye](https://rye.astral.sh/) puis faire:
* `rye sync`
* `rye run pong` (si vous voulez lancer le pong par example)

## Une idée à ajouter ?

Les pull requests sont les bienvenues sur ce dépôt ! Et si vous envoyez votre code d'ici la fin du mois (juin 2024), vous aurez potentiellement la chance de le voir être exécuté sur une vraie croix de pharmacie 😉

Pour soumettre une idée si vous n'êtes pas en mesure de coder, n'hésitez pas à créer [une issue GitHub](https://github.com/MathisHammel/CroixPharmacie/issues), ou m'envoyer des propositions en [DM sur Twitter](https://twitter.com/MathisHammel).

## Comment exécuter Doom ?

L'exécution du module Doom est dépendante de cyDoomGeneric, un wrapper de DoomGeneric. L'installation se fait en plusieurs étapes :

```bash
git clone https://github.com/wojciech-graj/cydoomgeneric
cd cydoomgeneric/cydoomgeneric
python setup.py install
```

Vous pouvez maintenant exécuter doom.py pour le lancer sur la croix de pharmacie ! Utilisez les flèches pour vous déplacer, Ctrl gauche pour tirer, et la barre espace pour ouvrir les portes.
## Comment jouer à Doom ?
Utilisez les flèches pour vous déplacer, Ctrl gauche pour tirer, et la barre espace pour ouvrir les portes.
44 changes: 44 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[project]
name = "croix_pharmacie"
version = "1.0.0"
description = "Ce projet permet de contrôler à distance l'affichage d'une croix de pharmacie. Si vous n'avez pas la chance de posséder une croix de pharmacie chez vous, le code vous permet également de simuler l'affichage localement."
authors = [
{ name = "Mathis Hammel" }
]
dependencies = [
"pygame>=2.5.2",
"opencv-python>=4.9",
"moviepy>=1.0.3",
"matplotlib>=3.7",
"pydub>=0.25.1",
"cydoomgeneric @ git+https://github.com/wojciech-graj/cydoomgeneric",
]
readme = "README.md"
requires-python = ">= 3.11"

[project.scripts]
"audio_visualizer" = "croix_pharmacie.scripts.audio_visualizer:main"
"cube" = "croix_pharmacie.scripts.cube:main"
"doom" = "croix_pharmacie.scripts.doom:main"
"example" = "croix_pharmacie.scripts.example:main"
"falling_sand_simulation" = "croix_pharmacie.scripts.falling_sand_simulation:main"
"flappyBird" = "croix_pharmacie.scripts.flappyBird:main"
"plasma" = "croix_pharmacie.scripts.plasma:main"
"pong" = "croix_pharmacie.scripts.pong:main"
"rotozoom" = "croix_pharmacie.scripts.rotozoom:main"
"simon" = "croix_pharmacie.scripts.simon:main"
"snake" = "croix_pharmacie.scripts.snake:main"
"tetris" = "croix_pharmacie.scripts.tetris:main"
"videoplayer" = "croix_pharmacie.scripts.videoplayer:main"
"visual_effects" = "croix_pharmacie.scripts.visual_effects:main"
"youreundercontrol" = "croix_pharmacie.scripts.youreundercontrol:main"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.metadata]
allow-direct-references = true

[tool.hatch.build.targets.wheel]
packages = ["src/croix_pharmacie"]
40 changes: 40 additions & 0 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# generated by rye
# use `rye lock` or `rye sync` to update this lockfile
#
# last locked with the following flags:
# pre: false
# features: []
# all-features: false
# with-sources: false
# generate-hashes: false
# universal: false

-e file:.
certifi==2024.8.30
charset-normalizer==3.4.0
colorama==0.4.6
contourpy==1.3.0
cycler==0.12.1
cydoomgeneric @ git+https://github.com/Baduit/cydoomgeneric@b20705b303e74b28985396cc5f06637e53607b16
decorator==4.4.2
fonttools==4.54.1
idna==3.10
imageio==2.36.0
imageio-ffmpeg==0.5.1
kiwisolver==1.4.7
matplotlib==3.9.2
moviepy==1.0.3
numpy==2.0.2
opencv-python==4.10.0.84
packaging==24.1
pillow==11.0.0
proglog==0.1.10
pydub==0.25.1
pygame==2.6.1
pyparsing==3.2.0
python-dateutil==2.9.0.post0
requests==2.32.3
setuptools==75.2.0
six==1.16.0
tqdm==4.66.5
urllib3==2.2.3
Loading