Skip to content

Commit 8e94159

Browse files
committed
Info about input function in the main thread and JS prompts.
1 parent 1aad1bd commit 8e94159

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Diff for: docs/user-guide/pygame-ce.md

+11
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@ on the page.
4040
A config attribute can be specified to add extra packages but right now that's
4141
all it can do.
4242

43+
!!! Info
44+
45+
Sometimes you need to gather text based user input when starting a game.
46+
The usual way to do this is via the builtin `input` function.
47+
48+
Because PyGame-CE **only runs on the main thread**, the only way to block
49+
your code while it waits for user `input` is to use a
50+
[JavaScript prompt](https://developer.mozilla.org/en-US/docs/Web/API/Window/prompt)
51+
instead of input typed in via a terminal. PyScript handles this
52+
automatically for you if you use the `input` function.
53+
4354
This is an experiment, but:
4455

4556
* It is possible to use regular PyScript to load the pygame-ce package and use

0 commit comments

Comments
 (0)