Help w/hop ATL using full body sprites [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
sheetcakeghost
Veteran
Posts: 383
Joined: Sat Sep 19, 2009 9:19 pm
Contact:

Help w/hop ATL using full body sprites [SOLVED]

#1 Post by sheetcakeghost »

Okay, so I'm trying to make a sprite hop on screen. Right now I'm using this transition.

Code: Select all

transform hop:
    yalign 0.0
    linear 0.3 yalign 1.0
This worked perfectly fine with the dummy sprite, but when I decided to use full body sprites it got a bit funny.

Image
See, to use the full body sprite (which goes off the screen and both the top and the bottom of the sprite) I needed to define where the floor was.

Code: Select all

$ floor_height = 1200
This also works fine until I try to use that atl. If I use it as is I end up with the sprite ignoring where I defiled the floor.
Image
If I change the yalign to match the floor (changing it to 1200 or floor_height) it positions him with the tip of his ears on the top.
Image
It also doesn't make him do the jump animation.

I hope my issue here makes sense (I've been at this for about two days now and I'm very burned out from the troubleshooting and research I did that brought me no results) and that I'm not coming off very rude. I'm not really a coder so all I can do is parrot and Frankenstein code provided to me. I need to get this sorted before the end of the month (for the sugar sweets and jam deadline that we're hoping to have a functional demo for) so quick and dirty solutions are acceptable here.

Thank you for your time.
Last edited by sheetcakeghost on Thu Apr 28, 2016 3:08 pm, edited 1 time in total.

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Help w/hop ATL using full body sprites when floor is def

#2 Post by xela »

You might want to consider using offset for this, I found it perfect for stuff like jumping. Also maybe one of the new easing functions instead of linear. Look for both in the atl docs, this is very easy to set up and it should run really well.
Like what we're doing? Support us at:
Image

User avatar
sheetcakeghost
Veteran
Posts: 383
Joined: Sat Sep 19, 2009 9:19 pm
Contact:

Re: Help w/hop ATL using full body sprites when floor is def

#3 Post by sheetcakeghost »

Thanks for the advice, Xela! You helped me get pointed in the right direction. I changed the code to this.

Code: Select all

transform hop:
    yalign 1.0
    easeout 0.2 yalign 0.2 yoffset 21
And it works perfectly!

User avatar
xela
Lemma-Class Veteran
Posts: 2481
Joined: Sun Sep 18, 2011 10:13 am
Contact:

Re: Help w/hop ATL using full body sprites [SOLVED]

#4 Post by xela »

Ok, not exactly what I meant but as long as it's working :)
Like what we're doing? Support us at:
Image

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]