Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function jump(event){
- if(event.keyCode == 38){
- cube.pula();
- }
- }
- function walk(){
- if(event.keyCode == 39){
- cube.right();
- }
- if(event.keyCode == 37){
- cube.left();
- }
- }
- pula: function(event){
- if(this.jps < 2){
- this.jps++;
- this.v = -this.fp;
- }else if(this.y == 250){
- this.jps = 0;
- this.jps++;
- this.v = -this.fp;
- }
- },
- right: function(){
- if(this.x <= width-64){
- this.x += this.force;
- }
- },
- left: function(){
- if(this.x >= 15){
- this.x += -this.force;
- }
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement