sBlockSand
0
-1
-101
0
oSolid
sSolid
1
603
7
0
0
-1
2
self
0
0
1
event_inherited();
image_speed = 0;
tileid = -1;
tilesandcrn0 = -1;
tilesandcrn1 = -1;
tilesandcrn2 = -1;
tilesandcrn3 = -1;
//Sand Fix
pos = string(x)+","+string(y);
//tileid = string_copy(global.sandarray[x,y], 1, 2);
if(room!=rm_a3h04) event_user(1);
else alarm[2] = 1;
//In case of emergency, cause both event_user(1) and alarm[2] to activate if in rm_a3ho4. Also mess with oTestKeys W key event, and oBlockSand alarm 2.
1
603
7
0
0
-1
2
self
0
0
1
instance_activate_region(x - 32, y - 32, 64, 64, 1);
with (instance_position(x, y - 16, oBlockSand)) alarm[0] = 1;
with (instance_position(x + 16, y, oBlockSand)) alarm[0] = 1;
with (instance_position(x, y + 16, oBlockSand)) alarm[0] = 1;
with (instance_position(x - 16, y, oBlockSand)) alarm[0] = 1;
with (instance_position(x + 16, y - 16, oBlockSand)) alarm[0] = 1;
with (instance_position(x + 16, y + 16, oBlockSand)) alarm[0] = 1;
with (instance_position(x - 16, y + 16, oBlockSand)) alarm[0] = 1;
with (instance_position(x - 16, y - 16, oBlockSand)) alarm[0] = 1;
1
603
7
0
0
-1
2
self
0
0
1
// - Emergency code for regenerating sand tile maps
/*ds_map_add(global.sand_map,pos,image_index);
ds_map_add(global.sandcrn0_map,pos,tilesandcrn0);
ds_map_add(global.sandcrn1_map,pos,tilesandcrn1);
ds_map_add(global.sandcrn2_map,pos,tilesandcrn2);
ds_map_add(global.sandcrn3_map,pos,tilesandcrn3);
*/
// - Normal event code begins here
tileid = tile_add(tlSandBlocks, ds_map_find_value(global.sand_map, pos)*16, 0, 16, 16, x, y, -100);
if (ds_map_find_value(global.sandcrn0_map, pos)) tilesandcrn0 = tile_add(tlSandCorners, 0*16, 0, 16, 16, x, y, -101);
if (ds_map_find_value(global.sandcrn1_map, pos)) tilesandcrn1 = tile_add(tlSandCorners, 1*16, 0, 16, 16, x, y, -101);
if (ds_map_find_value(global.sandcrn2_map, pos)) tilesandcrn2 = tile_add(tlSandCorners, 2*16, 0, 16, 16, x, y, -101);
if (ds_map_find_value(global.sandcrn3_map, pos)) tilesandcrn3 = tile_add(tlSandCorners, 3*16, 0, 16, 16, x, y, -101);
1
603
7
0
0
-1
2
self
0
0
1
tileid = tile_add(tlSandBlocks, image_index*16, 0, 16, 16, x, y, -100);
if (sandcrn0) tilesandcrn0 = tile_add(tlSandCorners, 0*16, 0, 16, 16, x, y, -101);
if (sandcrn1) tilesandcrn1 = tile_add(tlSandCorners, 1*16, 0, 16, 16, x, y, -101);
if (sandcrn2) tilesandcrn2 = tile_add(tlSandCorners, 2*16, 0, 16, 16, x, y, -101);
if (sandcrn3) tilesandcrn3 = tile_add(tlSandCorners, 3*16, 0, 16, 16, x, y, -101);
1
603
7
0
0
-1
2
self
0
0
1
event_user(1);
1
603
7
0
0
-1
2
self
0
0
1
if (tile_exists(tileid)) {
tile_delete(tileid);
tileid = -1;
}
if (tile_exists(tilesandcrn0)) {
tile_delete(tilesandcrn0);
tilesandcrn0 = -1;
}
if (tile_exists(tilesandcrn1)) {
tile_delete(tilesandcrn1);
tilesandcrn1 = -1;
}
if (tile_exists(tilesandcrn2)) {
tile_delete(tilesandcrn2);
tilesandcrn2 = -1;
}
if (tile_exists(tilesandcrn3)) {
tile_delete(tilesandcrn3);
tilesandcrn3 = -1;
}
instance_activate_region(x - 32, y - 32, 64, 64, 1);
if (instance_position(x, y - 16, oBlockSand)) {
sandu = 1;
} else sandu = 0;
if (instance_position(x + 16, y, oBlockSand)) {
sandr = 1;
} else sandr = 0;
if (instance_position(x, y + 16, oBlockSand)) {
sandd = 1;
} else sandd = 0;
if (instance_position(x - 16, y, oBlockSand)) {
sandl = 1;
} else sandl = 0;
if (instance_position(x + 16, y - 16, oBlockSand)) {
sandur = 1;
} else sandur = 0;
if (instance_position(x - 16, y - 16, oBlockSand)) {
sandul = 1;
} else sandul = 0;
if (instance_position(x + 16, y + 16, oBlockSand)) {
sanddr = 1;
} else sanddr = 0;
if (instance_position(x - 16, y + 16, oBlockSand)) {
sanddl = 1;
} else sanddl = 0;
if (sandu && sandr && !sandur) {
sandcrn2 = 1;
} else sandcrn2 = 0;
if (sandu && sandl && !sandul) {
sandcrn3 = 1;
} else sandcrn3 = 0;
if (sandd && sandr && !sanddr) {
sandcrn0 = 1;
} else sandcrn0 = 0;
if (sandd && sandl && !sanddl) {
sandcrn1 = 1;
} else sandcrn1 = 0;
if (sandu && sandr && sandd && sandl) image_index = 0;
if (!sandu && sandr && sandd && sandl) image_index = 1;
if (sandu && !sandr && sandd && sandl) image_index = 2;
if (sandu && sandr && !sandd && sandl) image_index = 3;
if (sandu && sandr && sandd && !sandl) image_index = 4;
if (!sandu && !sandr && sandd && sandl) image_index = 5;
if (sandu && !sandr && !sandd && sandl) image_index = 6;
if (sandu && sandr && !sandd && !sandl) image_index = 7;
if (!sandu && sandr && sandd && !sandl) image_index = 8;
if (!sandu && sandr && !sandd && sandl) image_index = 9;
if (sandu && !sandr && sandd && !sandl) image_index = 10;
if (!sandu && sandr && !sandd && !sandl) image_index = 11;
if (!sandu && !sandr && sandd && !sandl) image_index = 12;
if (!sandu && !sandr && !sandd && sandl) image_index = 13;
if (sandu && !sandr && !sandd && !sandl) image_index = 14;
if (!sandu && !sandr && !sandd && !sandl) image_index = 15;
alarm[1] = 1;
1
603
7
0
0
-1
2
self
0
0
1
repeat (2) {
smk = instance_create(x + 2 + random(10), y + 2 + random(10), oFXAnimSpark);
smk.image_speed = 0.6 + random(0.7);
smk.additive = 0;
smk.sprite_index = sSmoke1;
smk.image_alpha = 0.4;
smk.direction = 250 + random(40);
smk.speed = random(1);
smk.depth = -101;
}
if (tile_exists(tileid)) {
tile_delete(tileid);
tileid = -1;
}
if (tile_exists(tilesandcrn0)) {
tile_delete(tilesandcrn0);
tilesandcrn0 = -1;
}
if (tile_exists(tilesandcrn1)) {
tile_delete(tilesandcrn1);
tilesandcrn1 = -1;
}
if (tile_exists(tilesandcrn2)) {
tile_delete(tilesandcrn2);
tilesandcrn2 = -1;
}
if (tile_exists(tilesandcrn3)) {
tile_delete(tilesandcrn3);
tilesandcrn3 = -1;
}
alarm[0] = 1;
sfx_stop(sndBlockDestroy);
sfx_play(sndBlockDestroy);
instance_destroy();
0
0
0
0.5
0.100000001490116
0
0.100000001490116
0.100000001490116
0.200000002980232
-1
-1