Advertisement
Guest User

Untitled

a guest
Sep 21st, 2014
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. init: function{
  2. var mass = 1;
  3. var width = 1, height = 1;
  4. this.playerBody = new cp.Body(mass , cp.momentForBox(mass, width, height));
  5. this.space.addBody(this.playerBody);
  6.  
  7. this.schedule(this.move);
  8. },
  9. move: function(dt){
  10. this.space.step(dt);
  11. this.playerBody.getPos().x += 2 * dt;
  12. this.playerBody.getPos().y += 2 * dt;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement