Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //ffc solidity for canwalk
- //chexck this in the canwalk() function that Link uses
- //FFCs are part of the current mapscreen, and all of their values are available.
- for ( int q = 0; q < 31; ++q )
- {
- /*skip all ffs with the solid flag off, to save system overhead*/
- if ( !(Maps.FFCFlags[q]&FFCSOLID) ) continue;
- switch(dir)//Link's dir
- {
- case DIR_UP:
- {
- /*find the bottom of the ffc effectheight
- and is Y
- */
- if ( stepdest_y > bottom_hitbox || stepdest_y < ffc_y )
- /* before its edge, or beyond its other edge*/
- break;
- /*then find out if Link's X is within the X+effectwidth
- of the ffc*/
- /*if not, then we break*/
- /*if it is, then we can't walk, and return false*/
- }
- case DIR_DOWN:
- {
- /*find the top of the ffc effectheight
- and is Y
- */
- if ( stepdest_y < top_hitbox || stepdest_y > ffc_Y )
- /* before its edge, or beyond its other edge*/
- break;
- /*then find out if Link's X is within the X+effectwidth
- of the ffc*/
- /*if not, then we break*/
- /*if it is, then we can't walk, and return false*/
- }
- case DIR_LEFT:
- {
- /* find the right edge of the ffc effectwidth
- and its X*/
- if ( stepdest_x > right_hitbox || stepdest_x < ffc_x ) )
- /* before its edge, or beyond its other edge*/
- break;
- /*then find out if Link's Y is within the Y+effectheight
- of the ffc*/
- /*if not, then we break*/
- /*if it is, then we can't walk, and return false*/
- }
- case DIR_RIGHT:
- {
- /* find the left edge of the ffc effectwidth
- and its X*/
- if ( stepdest_x < right_hitbox || stepdest_x > ffc_x ) )
- /* before its edge, or beyond its other edge*/
- break;
- /*then find out if Link's Y is within the Y+effectheight
- of the ffc*/
- /*if not, then we break*/
- /*if it is, then we can't walk, and return false*/
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement