Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. function jump(event){
  2. if(event.keyCode == 38){
  3. cube.pula();
  4. }
  5. }
  6.  
  7.  
  8. function walk(){
  9. if(event.keyCode == 39){
  10. cube.right();
  11. }
  12. if(event.keyCode == 37){
  13. cube.left();
  14. }
  15. }
  16.  
  17. pula: function(event){
  18. if(this.jps < 2){
  19. this.jps++;
  20. this.v = -this.fp;
  21. }else if(this.y == 250){
  22. this.jps = 0;
  23. this.jps++;
  24. this.v = -this.fp;
  25. }
  26. },
  27.  
  28. right: function(){
  29. if(this.x <= width-64){
  30. this.x += this.force;
  31. }
  32. },
  33.  
  34.  
  35. left: function(){
  36. if(this.x >= 15){
  37. this.x += -this.force;
  38. }
  39. },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement