Tetris (raylib classic)¶
Grid logic, rotation, line clears, score HUD.
▶ Run in browserUpstream: https://github.com/raysan5/raylib-games/tree/master/classics/src
Tags: port tier-0
Tetris (raylib classic): SimVX port¶
Faithful port of raylib-games/classics/src/tetris.c.
Run¶
uv run python ported_games/raylib_classics/tetris/simvx_port/main.py
Controls¶
Key |
Action |
|---|---|
LEFT / RIGHT |
Move piece sideways |
UP |
Rotate piece 90° CW |
DOWN |
Soft drop (after holding briefly) |
P |
Pause / resume |
ENTER |
Restart after game over |
Web export¶
uv run simvx export web ported_games/raylib_classics/tetris/simvx_port/main.py \
-o ported_games/raylib_classics/tetris/simvx_port/web/index.html
Source¶
1#!/usr/bin/env python3
2# /// script
3# requires-python = ">=3.13"
4# dependencies = ["simvx-core", "simvx-graphics"]
5# ///
6"""Tetris (raylib classic): Grid logic, rotation, line clears, score HUD.
7
8# /// simvx
9# tags = ["port", "tier-0"]
10# upstream = "https://github.com/raysan5/raylib-games/tree/master/classics/src"
11# web = { width = 600, height = 600, responsive = true }
12# ///
13
14Run::
15
16 uv run python ported_games/raylib_classics/tetris/simvx_port/main.py
17
18Web export::
19
20 uv run simvx export web ported_games/raylib_classics/tetris/simvx_port/main.py \
21 -o ported_games/raylib_classics/tetris/simvx_port/web/index.html
22"""
23
24import os
25import sys
26
27_HERE = os.path.abspath(os.path.dirname(__file__))
28if _HERE not in sys.path:
29 sys.path.insert(0, _HERE)
30
31from simvx.graphics import App # noqa: E402
32
33from nodes.tetris_game import TetrisGame # noqa: E402
34
35WIDTH, HEIGHT = 600, 600
36
37
38def main():
39 App(title="Tetris (raylib classic)", width=WIDTH, height=HEIGHT).run(TetrisGame())
40
41
42if __name__ == "__main__":
43 main()