<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
  <spriteName>&lt;undefined&gt;</spriteName>
  <solid>0</solid>
  <visible>-1</visible>
  <depth>0</depth>
  <persistent>0</persistent>
  <parentName>&lt;undefined&gt;</parentName>
  <maskName>&lt;undefined&gt;</maskName>
  <events>
    <event eventtype="2" enumb="0">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>/// GameMaker Is Stupid

for(var i = 0; i &lt; 16; i ++)
{
    var chunkat = instance_position(cX[i], cY[i],obj_chunk);
    if(chunkat == noone) // create
    {
        instance_create(cX[i],cY[i],obj_chunk);
    }
    else // load
    {
        if(chunkat.loaded = false)
        {
            with(chunkat){
                event_user(1);
            }
        }
    }
}
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="3" enumb="0">
      <action>
        <libid>1</libid>
        <id>603</id>
        <kind>7</kind>
        <userelative>0</userelative>
        <isquestion>0</isquestion>
        <useapplyto>-1</useapplyto>
        <exetype>2</exetype>
        <functionname></functionname>
        <codestring></codestring>
        <whoName>self</whoName>
        <relative>0</relative>
        <isnot>0</isnot>
        <arguments>
          <argument>
            <kind>1</kind>
            <string>/// 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 &lt; 0)
{
    chunkX -= chunk_total_size;
}

if(chunkY &lt; 0)
{
    chunkY -= chunk_total_size;
}

if(chunkY == 0 &amp;&amp; (playY &lt; 0 &amp;&amp; playY &gt;= chunk_total_size/-1) )
{
    chunkY = chunk_total_size/-1;
}

if(chunkX == 0 &amp;&amp; (playX &lt; 0 &amp;&amp; playX &gt;= 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 &lt; 4; xx++)
{
    for(var yy = 0; yy &lt; 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;

</string>
          </argument>
        </arguments>
      </action>
    </event>
  </events>
  <PhysicsObject>0</PhysicsObject>
  <PhysicsObjectSensor>0</PhysicsObjectSensor>
  <PhysicsObjectShape>0</PhysicsObjectShape>
  <PhysicsObjectDensity>0.5</PhysicsObjectDensity>
  <PhysicsObjectRestitution>0.100000001490116</PhysicsObjectRestitution>
  <PhysicsObjectGroup>0</PhysicsObjectGroup>
  <PhysicsObjectLinearDamping>0.100000001490116</PhysicsObjectLinearDamping>
  <PhysicsObjectAngularDamping>0.100000001490116</PhysicsObjectAngularDamping>
  <PhysicsObjectFriction>0.200000002980232</PhysicsObjectFriction>
  <PhysicsObjectAwake>-1</PhysicsObjectAwake>
  <PhysicsObjectKinematic>0</PhysicsObjectKinematic>
  <PhysicsShapePoints/>
</object>
