Top down view of an actor bouncing, how to change the size?
fattiatti
Member Posts: 2
Hi, I'm just starting to work on my first project and I've struck a bit of a problem. I want to simulate a bird's-eye view of a bouncing ball, with the ball appearing to change size (growing as it approaches you, shrinking as it gets further away). I'm a little stuck on how to do that, I've tried 'change size' with the formula [cos(game.time)], as I essentially want it to grow and shrink as the absolute value of cos(x).
Any suggestions or fixes?
Comments
use interpolate? I hear it's good. Also with 'change size' why don't you have it set to self.time instead of game.time?
There are a number of ways you can do this, you could constrain the height and width to:
100 *sin(( self.Time *200)%180)+100
or
100 *sin(mod(( self.Time *200),180))+100
or
100 *abs(sin( self.Time *200))+100
. . etc
(the last one uses the abs function to give you the absolute value of cos or sin).
Thanks, I'll try these out
Here's a quick demo file using AAA *abs(sin( self.Time *BBB))+CCC
Link: https://www.mediafire.com/?b44xh5k3ump5484
. . .