Hi! I liked this question, so I posted a quick article in reply here:
http://roaminggamer.com/2014/06/19/easy-ball-trails-corona-sdk/
https://www.youtube.com/watch?v=3JAe9fefHsY&feature=youtu.be&hd=1
Cheers,
Ed
Hi! I liked this question, so I posted a quick article in reply here:
http://roaminggamer.com/2014/06/19/easy-ball-trails-corona-sdk/
https://www.youtube.com/watch?v=3JAe9fefHsY&feature=youtu.be&hd=1
Cheers,
Ed
Is there a way to make the trails fade behind the ball after so long?
Thats what 86lemonade68’s code did. The
transition.to( Trail, {time = 500, alpha = 0, onComplete = function ()
display.remove( Trail )
end} )
Makes the trail fade out. However, its pretty easy to see that the trail is just circles when it does that and so it looks a bit ugly. That is why I asked if there was a way to make the trail look smoother.
I’m an idiot. Sorry was watching the video right above my post. Didn’t see that part.
Yeah, the effect I was going for is a very thin line and I’ve been tweaking the code a lot with no luck.
Its easy to miss something, dont take it so hard. Anyway, if you are using 86lemonade86’s code, then change r to be smaller
@All,
I updated the code frommy article, adding balls that fade after a while, and trail fading. I also added two additional drawTrail() examples (drawTrail2(), drawTrail3()).
You can get the code here: https://github.com/roaminggamer/RG_FreeStuff/tree/master/ballTrail
I got his code fully working. Trying to implement a solid line behind a ball. Haven’t had any luck yet! Have you?
No, not really. I changed
transition.to( Trail, {time = 500, alpha = 0, onComplete = function () display.remove( Trail ) end} )
to
transition.to( Trail, {time = 130, alpha = 0, onComplete = function() display.remove( Trail ) end} )
pretty much I changed the time to be shorter. You get a shorter trail, but while testing it, it looks pretty good. Make sure your game is set at 60fps.
Still, I wish there was a better way, especially for long trails.
If you want a solid line that doesn’t fade then I think roaminggamer’s code might work or you can just not have the transition that removes the trail (the code in this post) in 86lemonade68’s code.
I’m using his code in this game: http://www.indiedb.com/games/chalkboard-bounce and as I stated before. It looks decent, but definitely not state-of-the-art or awesome.