Get stage data

This function returns the either the size or coordinates of specific parts of the stage.

Syntax
get_stage_data( index );

Returns
real (either size or coordinates)

Basic
// init.gml // store top and bottom blastzone coordinates (avoids calling these functions again every frame) blastzone_t = get_stage_data(SD_TOP_BLASTZONE_Y); blastzone_b = get_stage_data(SD_BOTTOM_BLASTZONE_Y);

// update.gml // check if you're going to fall through bottom blastzone and teleport to the top if so var future_y = y + vsp; if ( future_y >= blastzone_b ) { y = blastzone_t; }

Advanced
// article1_init.gml // store blastzone coordinates (avoids calling these functions again every frame) blastzone_b = get_stage_data(SD_BOTTOM_BLASTZONE_Y); blastzone_l = get_stage_data(SD_LEFT_BLASTZONE_X); blastzone_r = get_stage_data(SD_RIGHT_BLASTZONE_R);

// article1_update.gml // if the article goes past the bottom, left, or right blastzones, it destroys itself and exits the script early if ( y > blastzone_b || x < blastzone_l || x > blastzone_r ) { instance_destroy(self); exit; }