Sprite movement speed? [SOLVED]

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
User avatar
asatiir
Regular
Posts: 86
Joined: Tue Oct 01, 2013 6:04 pm
Completed: Within the Walls (Twine)
Projects: Roses Will Rise
Organization: Asatiir's Tales
Skype: asatiir
itch: asatiir
Location: Dubai, UAE
Contact:

Sprite movement speed? [SOLVED]

#1 Post by asatiir » Mon Aug 29, 2016 10:37 am

I'm sure someone else asked this question but I've been trying to search for it the past few days and couldn't find an answer to what I need to do. I have a sprite in the center that I want to move slower than the default "move" speed. Is there any way to do that?

Code: Select all

show <image> at left
with move
Last edited by asatiir on Tue Aug 30, 2016 8:36 am, edited 1 time in total.
Image
Image

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: Sprite movement speed?

#2 Post by kivik » Mon Aug 29, 2016 11:06 am

According to the documentation here: https://www.renpy.org/doc/html/transiti ... l#var-move

You can create a MoveTransition() object:

https://www.renpy.org/doc/html/transiti ... Transition

So for example:

Code: Select all

show <image> at left
with MoveTransition(3.0)

User avatar
asatiir
Regular
Posts: 86
Joined: Tue Oct 01, 2013 6:04 pm
Completed: Within the Walls (Twine)
Projects: Roses Will Rise
Organization: Asatiir's Tales
Skype: asatiir
itch: asatiir
Location: Dubai, UAE
Contact:

Re: Sprite movement speed?

#3 Post by asatiir » Tue Aug 30, 2016 8:36 am

I was aware of MoveTransition pard, but didn't know that if I just put one number rather than a series of them it will count it only as duration, thanks a lot!
Image
Image

kivik
Miko-Class Veteran
Posts: 786
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: Sprite movement speed? [SOLVED]

#4 Post by kivik » Tue Aug 30, 2016 1:47 pm

Aha, basically if you see a function or class like this where it says something = something as parameters:

Code: Select all

MoveTransition(delay, enter=None, leave=None, old=False, layers=['master'], time_warp=None, enter_time_warp=None, leave_time_warp=None)
It means they're the default values supplied for it, so you can leave them blank. Any that doesn't have an equals reference means they're mandatory.

If you want to only specify specific parameters and ignoring the rest, you can do:

Code: Select all

MoveTransition(3.0, layers=['master','screens','overlay'])
And even though you're supplying it as a second parameter - it knows you're only specifying the layers parameter rather than the enter parameter and processes it accordingly.

Hope that's helpful!

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]