Advertisement
glitchdetector

[GML] object_tile_connect

Dec 31st, 2014
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ///object_tile_connect()
  2. // Assigns a sprite index depending on which objects are adjacent
  3. // Returns nothing.
  4.  
  5. image_speed = 0;
  6. image_index = 0;
  7.  
  8. if( place_meeting( x + sprite_width,    y,          object_index)) {image_index |= 1;}
  9. if( place_meeting( x,           y - sprite_height,  object_index)) {image_index |= 2;}
  10. if( place_meeting( x - sprite_width,    y,          object_index)) {image_index |= 4;}
  11. if( place_meeting( x,           y + sprite_height,  object_index)) {image_index |= 8;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement