Guest User

Untitled

a guest
Mar 1st, 2014
147
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         [oldVelX, oldVelY] = [@game.player.ref.body.velocity.x, @game.player.ref.body.velocity.y]
  2.  
  3.         @game.physics.collide @game.player.ref, @tileLayer
  4.         @game.physics.collide @game.player.ref, @fadingBlocks,
  5.             (ref, block) =>
  6.                 if ref.body.touching.down
  7.                     @game.player.onBlock = true
  8.  
  9.                 if ref.body.touching.right
  10.                     ref.body.x += (block.body.left - ref.body.right)
  11.                     ref.body.velocity.x = 0
  12.                     ref.body.velocity.y = oldVelY
  13.  
  14.                 if ref.body.touching.left
  15.                     ref.body.x += (block.body.right - ref.body.left)
  16.                     ref.body.velocity.x = 0
  17.                     ref.body.velocity.y = oldVelY
  18.  
  19.             , (ref, block) => block.currentFrame.index is 0
RAW Paste Data