Guest User

Game Maker Jump Through Platform Codes

a guest
Dec 3rd, 2013
1,417
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. Player Collision with Jump through platform:
  2.  
  3. if other.solid=true{move_contact_solid(direction,12) vspeed=0}
  4.  
  5. Jump through platform Step Event:
  6.  
  7. if obj_player.bbox_bottom > bbox_top {solid=false}else{solid=true} //Checks for player and determines if solid or not
  8.  
  9. EXTRA CODES (gravity, movement, ect, not needed for platform to work)
  10.  
  11. Player Step Event:
  12.  
  13. if place_free(x,y+1){gravity=0.7 gravity_direction=270}else{gravity=0 gravity_direction=270} //Gravity
  14. if place_free(x-4,y)&& keyboard_check(vk_left) //Move Left
  15. {
  16. x-=4
  17. }
  18. if place_free(x+4,y)&& keyboard_check(vk_right) //Move Right
  19. {
  20. x+=4
  21. }
  22. if keyboard_check_pressed(vk_up)
  23. {
  24. vspeed-=12
  25. }
Advertisement
Add Comment
Please, Sign In to add comment