๐ŸŒง๏ธ WORD RAIN in Python

The same downpour โ€” the falling, the matching and the levels all in Python

โ† Back to Fun Time
๐Ÿ Starting Pythonโ€ฆ
Score
0
Level
1
Lives
3
Best
0

โš™๏ธ Set it up

Start 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.

โ†‘ and โ†“ change it while you play

โŒจ๏ธ Controls

  • Just start typing โ€” no need to pick a word first
  • โ†‘ faster  โ€ข  โ†“ slower โ€” change the level whenever you like
  • BACKSPACE rub out a letter
  • SPACE give up on this word and start another
  • ENTER new game  โ€ข  ESC pause
  • ๐ŸŽฎ Xbox controller? Not this one, sorry โ€” this game is about typing letters, and a controller has no letters on it. Every other game takes a pad.

๐ŸŽฏ How to play

  • Type a word and it vanishes. Let one touch the ground and it costs you a life.
  • You never choose a word โ€” the letters do it for you. Type c and every word starting with c lights up.
  • The one with the line under it is the one you are on: always the lowest that still matches.
  • Three lives. Three words on the ground and the rain has won.

๐Ÿ“ˆ It gets faster

  • Every six words you clear takes you up a level.
  • Each level the words fall faster and arrive closer together.
  • Too slow or too easy? Press โ†‘ or โ†“ and change it yourself, mid-game.
  • Nobody lasts for ever. The question is how far you get.

๐Ÿ“š Your own word lists

  • Under the sky you can swap the everyday words for a Classical Roots lesson.
  • Pick one book, then tick as many lessons as you want.
  • Long words are given proportionally longer to fall, so a vocabulary lesson is a fair game and not an impossible one.
  • Your book, your lessons and your starting level are all remembered.

๐Ÿง‘โ€๐Ÿ’ป This whole game is Python

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.