So, I’m making a training to my game, where shows basics og my game. And I need arrow that pointing at something and moving(like this:)
P.S And “animate” text like that too
So, I’m making a training to my game, where shows basics og my game. And I need arrow that pointing at something and moving(like this:)
P.S And “animate” text like that too
There are quite a few ways of accomplishing this.
The most visually stylish way would probably be to create a sprite animation. That way, you could make the arrow bounce and/or rotate as it goes up and down. That’s how I’d go about doing this.
Another way would be to create two sets of transitions. First, you’d create a transition that brings the arrow up (or down). You can use one of Corona’s easing functions to make the arrow move at different speeds at different points in time (https://docs.coronalabs.com/api/library/easing/index.html). Then, add an onComplete to the first transition that starts the second transition. This time, use a different easing and move the arrow in the opposite direction. Again, add an onComplete that starts the first transition all over again.
Here’s some pseudo code.
local arrowTransition function transition1() arrowTransition = transition.to( target, { time=1000, y=Y1, transition=easing.SOMETHING, onComplete=transition2 } ) end function transition2() arrowTransition = transition.to( target, { time=1000, y=Y2, transition=easing.SOMETHING\_ELSE, onComplete=transition1 } ) end