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.
Hi! I'm planning my game to be a mix of a visual novel and a point-and-click adventure style game, so I'm trying to figure out methods to put in the player controlled walk segments. I'm using a slightly modified version of Per K Grok's code (Method 3) - I disliked the fact that the character would continuously walk after the player pressed the arrow key and the player would have to press the key a second time in order to make the character stop, as I felt it would be a bit confusing for the player, so I changed it in order to be more similar to the walking mechanics of a regular game (player holds down the key and the character walks, and stops when the player isn't holding down the key anymore). However, that made me run into a small problem: when a cycle is completed, the character disappears off the screen for a brief moment. I'd sincerely appreciate it if someone was willing to help me solve this issue!
lacticacid wrote: ↑Tue Mar 19, 2019 9:26 pm
Hi! I'm planning my game to be a mix of a visual novel and a point-and-click adventure style game, so I'm trying to figure out methods to put in the player controlled walk segments. I'm using a slightly modified version of Per K Grok's code (Method 3) - I disliked the fact that the character would continuously walk after the player pressed the arrow key and the player would have to press the key a second time in order to make the character stop, as I felt it would be a bit confusing for the player, so I changed it in order to be more similar to the walking mechanics of a regular game (player holds down the key and the character walks, and stops when the player isn't holding down the key anymore). However, that made me run into a small problem: when a cycle is completed, the character disappears off the screen for a brief moment. I'd sincerely appreciate it if someone was willing to help me solve this issue!
----
I do have one more method to add to my cock book thread that I've not yet come around to do a video on, that is addressing checking if the key is pressed down using the pygame library. https://www.pygame.org
Below a piece of code using that. That is probably a better path to go down to get what you are looking for.
While looking through the documentation last week, I needed to browse a section regarding the keymap and in it there was a section about the mouse buttons. https://www.renpy.org/doc/html/keymap.html
According to it, mousedown_1 is a variable set True while the left mouse button is held down, and mouseup_1 is True when it is released.
Similarly, it has key down and keyup for keyboard presses.
keydown
Matches when the key is being pressed down (the default).
keyup
Matches when the key is being released.
Maybe that could be used?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Per K Grok wrote: ↑Wed Mar 20, 2019 2:29 am
I do have one more method to add to my cock book thread that I've not yet come around to do a video on, that is addressing checking if the key is pressed down using the pygame library. https://www.pygame.org
Below a piece of code using that. That is probably a better path to go down to get what you are looking for.