Page 1 of 1

Moving characters

Posted: Fri May 22, 2015 12:02 am
by darkrchaos
So I have these two characters moving at the same time, then the images are suppose to switch before moving off screen. It's suppose to be like the two girls are running into each other. But the code isn't using the "shocked" images, it's only using the "normal" ones. When the characters hit the middle the "normal" ones move down. the "shock" ones very show up. What going on?

Code: Select all

  
    show karanormal2 at center
    show lillynormal2 at center
    with move
    
    hide karanormal2 
    hide lillynormal2 
    
    show lillyshock2
    show karashock2
    
    hide lillyshock2
    hide karashock2
    with moveoutbottom

Re: Moving characters

Posted: Fri May 22, 2015 12:14 am
by KomiTsuku
Time for a lesson in image attributes! To make this easy, here's how it should look and I'll explain why.

Code: Select all

    show kara normal2 at center
    show lilly normal2 at center
    with move
   
    show lilly shock2
    show kara shock2
   
    hide lilly shock2
    hide kara shock2
    with moveoutbottom
Right now, renpy doesn't know that the normal and shock images are related to each other. By putting the space in there, you're telling it that it is a kara/lilly image. When you call another kar/lillya image, it realizes that it needs to change the current kara/lilly image on screen. There's no need to hide them since it is replacing the kara/lilly image.

Re: Moving characters

Posted: Fri May 22, 2015 5:12 pm
by darkrchaos
Hmm That makes things easier, but the same thing is still happening it's still moving down the "Normal" one not the "Shock" one.

Re: Moving characters

Posted: Fri May 22, 2015 6:10 pm
by philat
It's because the transition is being applied to all the show/hide statements above it other than the initial show. You could break it up by adding a pause 0.1 after the show shock statements.

Re: Moving characters

Posted: Fri May 22, 2015 6:27 pm
by darkrchaos
That worked thank you :D