Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Jump through code (can either go in Step Event of idle or moving Jump Through Platform)
- if obj_player.bbox_bottom > bbox_top {solid=false}else{solid=true} //Checks for player and determines if solid or not
- Create Event of Moving Jump Through Platform:
- hspeed = 1
- Collision with collision object in Moving Jump Through Platform:
- hspeed = 1
- Collision with idle or Moving Jump Through Platform object in Player:
- if other.solid=true{move_contact_solid(direction,12) vspeed=0}
- Step Event of Player:
- //Optional Movement/Gravity System
- /*
- if place_free(x,y+1){gravity=0.7 gravity_direction=270}else{gravity=0 gravity_direction=270} //Gravity
- if place_free(x-4,y)&& keyboard_check(vk_left) //Move Left
- {
- x-=4
- }
- if place_free(x+4,y)&& keyboard_check(vk_right) //Move Right
- {
- x+=4
- }
- if keyboard_check_pressed(vk_up) //Bad Jumping System For Tutorial/Testing Purposes Only
- {
- vspeed-=12
- }
- */
- //Moving Platform Code
- if place_meeting(x,y+1,obj_moving_platform)//if there is a horizontal moving block under us
- {
- x+=instance_nearest(x,y+1,obj_moving_platform).hspeed//we move at the speed of the nearest horizontal block below us.
- }
Advertisement
Add Comment
Please, Sign In to add comment