<!--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="0" 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>loaded_chunks[64] = 0;
//load_chunk(0,0);

</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 / Unload 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;
}


instance_activate_region(chunkX,chunkY,1,1,true);
var chunkat = instance_position(chunkX, chunkY,obj_chunk);

if(chunkat == noone) // create
{
    show_debug_message("Generating chunk: "+string(chunkX)+","+string(chunkY));
    instance_create(chunkX,chunkY,obj_chunk);
}
else // load
{
    if(chunkat.loaded = false)
    {
        show_debug_message("Loading chunk: "+string(chunkX)+","+string(chunkY));
        event_perform_object(chunkat,ev_user1,0);
    }
}
</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>
