Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function sine(t, tMax, start, delta)
- return math.sin(math.pi * 2 * t/tMax) * delta
- end
- local function cosine(t, tMax, start, delta)
- return math.cos(math.pi * 2 * t/tMax) * delta
- end
- display.setStatusBar(display.statusBarHidden)
- local square = display.newRect( 0, 0, 50, 50 )
- local _W, _H = display.contentWidth, display.contentHeight
- square.x = _W * 0.5
- square.y = _H * 0.5
- transition.to(square, {time = 1000, y = -100, delta = true, transition = sine, iterations = 10})
- transition.to(square, {time = 1000, x = -100, delta = true, transition = cosine, iterations = 10})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement