Page 1 of 1

Waiting for keyboard input

Posted: Sat Sep 18, 2021 10:05 am
by Ivlivs
How do I make Ren'Py wait for keyboard input while a graphic is on the screen, then respond to that input when a button is pressed? (for example, moving a character in a platformer.)

Re: Waiting for keyboard input

Posted: Sat Sep 18, 2021 11:16 am
by Alex
Ivlivs wrote: Sat Sep 18, 2021 10:05 am How do I make Ren'Py wait for keyboard input while a graphic is on the screen, then respond to that input when a button is pressed? (for example, moving a character in a platformer.)
It's not an easy task.
You could make a screen and make some keys do some actions:
https://www.renpy.org/doc/html/screens.html
https://www.renpy.org/doc/html/screens.html#key
https://www.renpy.org/doc/html/screen_actions.html

Or you could use sprite manager to show some objects onscreen and respond to keys/mouse inputs:
https://www.renpy.org/doc/html/sprites.html
viewtopic.php?f=8&t=29439&p=352728&hilit=rythm#p352728

Or use pygame - https://www.renpy.org/wiki/renpy/doc/co ... onami_Code

Also, check this recipes:
viewtopic.php?f=51&t=53333#p502719
viewtopic.php?f=51&t=52871#p500587

Re: Waiting for keyboard input

Posted: Sat Sep 18, 2021 4:44 pm
by Ivlivs
Thanks! This is all beyond my ability of course, but it'll be useful should I attempt it.