Advertisement
Guest User

framerjs animation fix

a guest
Oct 22nd, 2014
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. box = new Layer
  2.     x: 320, y: 600, backgroundColor:"white", width: 200, height: 150
  3.  
  4. move = (speed) ->
  5.     box.animateStop()
  6.     box.animate
  7.         properties:
  8.             rotation: box.rotation+360
  9.         time: speed
  10.         repeat: 999
  11.  
  12. fast = false
  13. box.on Events.Click, ->
  14.     if fast
  15.         move(1)
  16.         fast = false
  17.     else
  18.         move(5)
  19.         fast = true
  20.  
  21. move(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement