Moving more than one sprite in the same time?

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:

Moving more than one sprite in the same time?

#1 Post by asatiir » Tue Jan 12, 2016 2:42 am

I tried digging here for an answer to this, there was a thread on parallax backgrounds but that's not what I'm looking for. I have a scene where the view keeps shifting from side to another with characters popping up, I would like to make them move simultaneously but the sprites and backgrounds are moving in turn. How do I fix this? If it's any help, here's the code I have right now:

Code: Select all

    show fircell at left with easeinleft
    show firaldamock flip at center with easeinright
    hide souilamocksil with easeoutright
    show thereaedimock at left with dissolve
    show firaldamock at right with dissolve
Image
Image

philat
Eileen-Class Veteran
Posts: 1853
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Moving more than one sprite in the same time?

#2 Post by philat » Tue Jan 12, 2016 3:37 am

I don't understand what exactly you want to happen, but transitions (commands like easeinleft, dissolve that are used with "with") wait to finish before moving onto the next line. You can either apply transitions to multiple elements like below or use ATL instead, which does not wait.

Code: Select all

show image at left
show image2 at right
with dissolve
# will apply dissolve to both images at once

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: Moving more than one sprite in the same time?

#3 Post by asatiir » Tue Jan 12, 2016 5:20 am

What I'm trying to do is have the character sprites and background do give off a perspective effect to that particular scene, main character (center) would talk to one person on one side, then the background would pan to the opposite side to show the other character. your solution would work if they all were all doing the same command, I'll try the ATL you mention and see how it works. Thanks
Image
Image

User avatar
Winterslice
Veteran
Posts: 228
Joined: Mon Sep 28, 2015 3:51 am
Completed: The Next World, Golem Creation Kit
Organization: Illuminated Games
Contact:

Re: Moving more than one sprite in the same time?

#4 Post by Winterslice » Tue Jan 12, 2016 12:12 pm

Yeah, those transitions aren't gonna do the job there. Transforms are what you want. Specify screen positions for each character (offscreen positions like, say, xalign 2.0 can be used to hide sprites from view) and use the move transition on all of them at once like philat suggested. For moving the background, you could put a transform on it with xoffset. That's what I use for this kind of effect. 'Course, someone else might know a better solution for that.

Post Reply

Who is online

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