<undefined>
0
-1
0
0
<undefined>
<undefined>
1
603
7
0
0
-1
2
self
0
0
1
global.allchunks = ds_list_create();
1
603
7
0
0
-1
2
self
0
0
1
/// GameMaker Is Stupid
for(var i = 0; i < 16; i ++)
{
var chunkat = instance_position(cX[i], cY[i],obj_chunk);
if(chunkat == noone) // create
{
var chunkInstId = instance_create(cX[i],cY[i],obj_chunk);
ds_list_add(global.allchunks,chunkInstId);
}
else // load
{
if(chunkat.loaded = false)
{
with(chunkat){
event_user(1);
}
}
}
}
1
603
7
0
0
-1
2
self
0
0
1
/// Load Chunks
var playX = obj_player.x;
var playY = obj_player.y;
var chunk_total_size = (CHUNK_SIZE*TILE_SIZE);
var chunkRelX = playX % chunk_total_size;
var chunkRelY = playY % chunk_total_size;
var chunkX = (obj_player.x - chunkRelX);
var chunkY = (obj_player.y - chunkRelY);
// Fix annoyances where % negative = positive
if(chunkX < 0)
{
chunkX -= chunk_total_size;
}
if(chunkY < 0)
{
chunkY -= chunk_total_size;
}
if(chunkY == 0 && (playY < 0 && playY >= chunk_total_size/-1) )
{
chunkY = chunk_total_size/-1;
}
if(chunkX == 0 && (playX < 0 && playX >= chunk_total_size/-1) )
{
chunkX = chunk_total_size/-1;
}
chunkX -= chunk_total_size;
chunkY -= chunk_total_size;
// Load Chunks
cX[16] = 0;
cY[16] = 0;
var i = 0;
for(var xx = 0; xx < 4; xx++)
{
for(var yy = 0; yy < 4; yy++)
{
instance_activate_region(chunkX+(chunk_total_size*xx),chunkY+(chunk_total_size*yy),1,1,true);
cX[i] = chunkX+(chunk_total_size*xx)
cY[i] = chunkY+(chunk_total_size*yy)
i++;
}
}
alarm[0] = 1;
0
0
0
0.5
0.100000001490116
0
0.100000001490116
0.100000001490116
0.200000002980232
-1
0