The same downpour โ the falling, the matching and the levels all in Python
โ Back to Fun TimeStart wherever you like, and race on the everyday words or on a Classical Roots lesson. Pick one book, then tick as many lessons as you want.
There is almost no JavaScript on this page. The browser downloaded Pyodide โ a complete Python interpreter compiled to WebAssembly โ and then ran the .py files in funtime/pylib/. Python does the rules, the maths and the drawing.
| File | What it does | Good functions to try re-writing |
|---|---|---|
| pylib/wordfall_rules.py | The rules: the falling, the matching, the levels | speed_for_level, matching_word, type_letter, zap_word |
| pylib/wordfall_draw.py | Painting the sky โ Python calling the canvas | draw_word, draw_ground, render_game |
| pylib/wordfall_web.py | The glue: the keyboard, the phone keyboard, the loop | do_action, on_hidden_input, frame |
๐ Compare the two versions. Open lib/wordfall-rules.js and pylib/wordfall_rules.py side by side โ same ideas, two languages.
๐ ๏ธ Build it yourself: Build Word Rain in Python walks you through the functions one at a time.
โ ๏ธ If the game never starts: the page has to read its .py files, which a browser will not do for a page opened straight off your disk. Use the live site, or run python3 -m http.server in the project folder.