Advertisement
Sniperninja564

20% Project Code 1

Oct 28th, 2016
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Check for ground
  2. if (place_meeting(x, y+1, obj_wall)) {
  3.     vspd = 0;
  4.     sprite_index = walk;
  5.     airjump = 1;
  6.  
  7.     // Jumping
  8.     if (jump_key) {
  9.         vspd = -jspd;
  10.         audio_play_sound(snd_jump, 5, false);
  11.     }
  12. } else {
  13.     // Gravity
  14.     if (vspd <= 10) {
  15.         vspd += grav;
  16.     }
  17.  
  18.     sprite_index = jump;
  19.  
  20.     // Check For Double Jump
  21.     if (airjump > 0) {
  22.         if (jump_key) {
  23.             vspd = -jspd/1.2;
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement