glitchdetector icon

[GML] object_tile_connect

glitchdetector | PRO | 01/01/15 12:31:29 AM UTC | 0 ⭐ | 545 👁️ | Never ⏰ | []
Game Maker |

0 B

|

None

|

0 👍

/

0 👎

///object_tile_connect()
// Assigns a sprite index depending on which objects are adjacent
// Returns nothing.
 
image_speed = 0;
image_index = 0;
 
if( place_meeting( x + sprite_width,    y,          object_index)) {image_index |= 1;}
if( place_meeting( x,           y - sprite_height,  object_index)) {image_index |= 2;}
if( place_meeting( x - sprite_width,    y,          object_index)) {image_index |= 4;}
if( place_meeting( x,           y + sprite_height,  object_index)) {image_index |= 8;}

Comments