Guest User

Untitled

a guest
Jul 15th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. export default class Player {
  2. constructor(scene, x, y) {
  3. this.scene = scene;
  4.  
  5. // Create the physics-based sprite that we will move around and animate
  6. this.sprite = scene.physics.add
  7. .sprite(x, y, "player", 0)
  8. .setDrag(1000, 0)
  9. .setMaxVelocity(300, 400)
  10. .setSize(18, 24)
  11. .setOffset(7, 9);
  12.  
  13. // Set up animations & keyboard input (see CodeSandbox)
  14. }
  15.  
  16. update() {
  17. // Move sprite & change animation based on keyboard input (see CodeSandbox)
  18. }
  19.  
  20. destroy() {
  21. this.sprite.destroy();
  22. }
  23. }
Add Comment
Please, Sign In to add comment