Motion Trampoline Function is glitchy? [SOLVED]
Posted: Tue Nov 04, 2014 9:38 pm
I am using this motion function to animate a dog jumping up and down in my game.
However, it seems a bit glitchy, as when you click to get to the screen that the sprite is in, it flashes to the far left for a second before jumping up and down like it's supposed to. (The dog is originally a static sprite at the center of the screen, and it jumps up and down at the center of the screen like it's supposed to, but it flashing at the far left for a second is weird.) Does anyone have any ideas as to what I can do to fix this? Here is the code I'm using:
I should mention that I cut out the label start and any other code I thought was irrelevant.
Any thoughts or ideas would be much appreciated!
EDIT:
After TheChris's suggestion, I went back and changed the code to ATL, and sure enough, it worked without a hitch! Here's what I ended up using:
However, it seems a bit glitchy, as when you click to get to the screen that the sprite is in, it flashes to the far left for a second before jumping up and down like it's supposed to. (The dog is originally a static sprite at the center of the screen, and it jumps up and down at the center of the screen like it's supposed to, but it flashing at the far left for a second is weird.) Does anyone have any ideas as to what I can do to fix this? Here is the code I'm using:
Code: Select all
init:
python:
import math
def Trampoline(n):
return (0.5, 1 - math.sin(math.pi * n), 0.5, 0)
play panting "music/laylapant.wav"
show laylajump
with moveinleft
with vpunch
n2 ""
hide laylajump
show screen quickmenu
show casey surprised
show laylajump2 at Motion(Trampoline, 3.4, repeat=True, bounce=True)
Any thoughts or ideas would be much appreciated!
EDIT:
After TheChris's suggestion, I went back and changed the code to ATL, and sure enough, it worked without a hitch! Here's what I ended up using:
Code: Select all
transform move_slide:
xalign 0.5 yalign 0.0
linear 0.6 yalign 0.6
linear 0.6 yalign 0.0
repeat