Files
silent-fh/README.md
niklasandClaude Opus 5.5 97348f884a feat(web): fill browser window and fix localhost loading
Use a custom pygbag template: canvas uses the full window (gui_divider 1),
black page background, and redirect localhost to 127.0.0.1 because the
pygbag runtime otherwise fetches pygame from a local :8000 dev proxy and
the game never starts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 23:11:40 +02:00

89 lines
3.3 KiB
Markdown

# Silent FH
In Silent FH, you play as a student trapped overnight in the FH Joanneum. During the night the professors turn into
monsters and hunt down the trapped students.
Your goal is to survive.
This project uses uv and PyGame as its main libraries.
To get uv, please see here: https://docs.astral.sh/uv/getting-started/installation/
To sync the dependencies, please run:
## Usage
```
uv sync
source .venv/bin/activate or source .venv/bin/activate.fish
uv run main.py
```
## Browser / Docker deployment
The game runs client-side through [Pygbag](https://pygame-web.github.io/)
(Python WebAssembly + pygame-ce). Docker builds the web bundle and serves it
with non-root Nginx; players do not share a game session.
```bash
docker build -t silent-fh:web .
docker run -d --name silent-fh --restart unless-stopped -p 8080:8080 silent-fh:web
```
Open **http://localhost:8080** (it redirects to `127.0.0.1`, because the
Pygbag runtime treats `localhost` as its dev server). The game scales to fill
the browser window while keeping its aspect ratio. Allow the initial runtime download to finish,
click the game/name field, enter a name, and press Enter. A desktop browser
with a keyboard is recommended; touch controls are not implemented.
Reload the page to start again after quitting the game.
Deployment notes:
- The container listens on **8080** and includes an HTTP healthcheck. Put it
behind your usual HTTPS reverse proxy for public hosting. No volumes needed.
- Both the image build and players' browsers need internet access. Pygbag's
versioned runtime and pygame-ce wheels are fetched from
`https://pygame-web.github.io/cdn/`; this is **not an offline/self-contained
runtime**. The container serves the game code and assets only.
- Browser highscores persist in `localStorage` per browser and site origin,
not on the server. Clearing site data clears scores; blocked storage falls
back to session-only scores. The desktop leaderboard is not published.
- Browser system fonts fall back to Pygame's bundled font. Audio may require
a click/key press before the browser permits playback.
- The native `uv run main.py` command still works. `Game.run()` is now async;
Python callers must await it.
Smoke checks (stdlib unittest, no extra test dependencies):
```bash
uv run python -m unittest discover -s tests -v
curl --fail http://localhost:8080/ > /dev/null
```
## Usage of the game:
- Use WASD or Arrow Keys to move around
- Use E to buy items (if you have enough ECTS)
- Survive or die
- Coffee heals the door
- Beer increases your ETCS generation
Live long enough and get the highest amount of ETCS you can!
### Coding Guidelines:
- Using branches for features, named like so: feat/feature-name
- Using pull requests and merging for code review
- Using semantic commits for a good overview of the changes, for example:
- feat(component): added new component
- fix(bug): fixed a bug
- docs(readme): updated documentation
- chore(ci): automated build and deployment
Game coded up by Baumgartner Kevin, Kammerhofer Lukas, Berger Lena and Haiden Niklas.
## Responsibilities
- Baumgartner Kevin: UI, Startscreen, Endscreen, Highscore Display
- Berger Lena: Sound Effects, HUD, ECTS System, Doors, Items (Beer and Coffee)
- Kammerhofer Lukas: Tower, Map, Design of the game
- Haiden Niklas: Merge Requests, Sprites, Zombies, Game Loop Logic, Docs