Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- init: function{
- var mass = 1;
- var width = 1, height = 1;
- this.playerBody = new cp.Body(mass , cp.momentForBox(mass, width, height));
- this.space.addBody(this.playerBody);
- this.schedule(this.move);
- },
- move: function(dt){
- this.space.step(dt);
- this.playerBody.getPos().x += 2 * dt;
- this.playerBody.getPos().y += 2 * dt;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement