Tree falling movement
app_sauce
Member, PRO Posts: 206
I'm trying to figure out how to get a tree falling effect in gs. I was messing around with the interpolate function as follows:
interpolate position x to (tree.height divided by 2)+(tree.width divided by 2)
interpolate position y to the y position of the ground
interpolate self.rotation to -90 (to have the tree fall to the right)
I set all of these to a duration of .5 seconds.
The results look wonky, the tree ends up landing in the position I want but I want the bottom of the tree to stay in place. You could also think of the motion as the falling of a domino piece.
I'm not sure what to change to make this look more natural.
Thanks for your help
SocializeTwitter , **My Site ** **Play Loop Zen Free **iOS HERE, Google Play HERE
Comments
Easy way would be to make your sprite with a half empty space so for eg tree height is 128 make a sprite 256 (the bottom half blank) and then you can simply use the rotate behaviour.
Darren.
Give this a try : https://drive.google.com/file/d/0B1vwAScC9gKKNE5KbDk2RC1zelE/view?usp=sharing
See also : http://www.arcaderz.com/how-to/
http://www.arcaderz.com
I'd use trigonometry to control the off-centre rotation - and then a falling control object to control the amount of bounce - doing it this way gives you lots of control over the speed of the fall, the amount of bounce and so on . . . .
I'll make a quick demo . . . .
Here you go, click on the white 'control'.
Link: https://www.mediafire.com/?25qj5dup632jcwc
. . .
Thanks guys just got a chance to check out these methods.
@Deepblueapps - I was thinking about just animating it.
@jeezzcake - I checked out your file it was similar to what I cooked up. The Tree moves down first which isn't very natural looking for what I need.
@socks - Cool stuff...just reading through your trig, interesting controller. Off center rotation seems like it should be easier but I think i'll be able to get what I need with your trig!
Thanks again guys
SocializeTwitter , **My Site ** **Play Loop Zen Free **iOS HERE, Google Play HERE