
thanks to fast loops, gravity and slopes can be handled by their own states, while the object moves around flawlessly up and down slopes.
execute "gravity" if "brick_type(0,1) == 0"
state "gravity"
{
gravity
}
no gravity applied if the bottom of the object is in contact with a solid brick. this solves a lot of gravity issues
execute "slope_correction" while "((brick_type(direction()*6, 0-1)) and (brick_type(0, 1)) and ((brick_angle(direction()*6, 0-1)<> 90)and (brick_angle(direction()*6, 0-1)<> 270))) or (brick_type(0, 0-16))"
state "slope_correction"
{
set_absolute_position xpos() ypos()-1
}
this prevents the object from using the default slope algorythm, replacing it with a "push out" whenever a slope is detected in front of the object. please notice that you may have to adjust the coordinates of brick functions to fit the size and shape of your object. precise level building is a must, NO OVERLAPPING BRICKS, or your walking object will fall when two bricks intersect.
goes well with
let "$angle = brick_angle(0, 4)"
set_angle $angle