Waiting for keyboard input

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Ivlivs
Veteran
Posts: 267
Joined: Sun Feb 25, 2007 1:00 pm
Contact:

Waiting for keyboard input

#1 Post 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.)
Jitteh Dawn --- A VN by Ivlivs

User avatar
Alex
Lemma-Class Veteran
Posts: 3090
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Waiting for keyboard input

#2 Post 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

Ivlivs
Veteran
Posts: 267
Joined: Sun Feb 25, 2007 1:00 pm
Contact:

Re: Waiting for keyboard input

#3 Post by Ivlivs »

Thanks! This is all beyond my ability of course, but it'll be useful should I attempt it.
Jitteh Dawn --- A VN by Ivlivs

Post Reply

Who is online

Users browsing this forum: Google [Bot]