Page 1 of 1

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

Posted: Wed Apr 27, 2016 5:09 pm
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.

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

Posted: Thu Apr 28, 2016 4:26 am
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.

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

Posted: Thu Apr 28, 2016 3:04 pm
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!

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

Posted: Thu Apr 28, 2016 3:23 pm
by xela
Ok, not exactly what I meant but as long as it's working :)