<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
  <spriteName>sTsumuri</spriteName>
  <solid>0</solid>
  <visible>-1</visible>
  <depth>-3</depth>
  <persistent>0</persistent>
  <parentName>oEnemy</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>action_inherited();
makeActive();
setCollisionBounds(-1, -1, 1, 1);
myhealth = 10;
damage = 6;
hitsound = sndEHit5;
deathsound = sndEDeath1;
platyoffset = -14;
frozenspr = sTsumuriFrozen;
target = 0;
canattack = 1;
state = 1;
myangle = 0;
update = 1;
sbstate = 0;
sbmove = 0;
angleprevious = 0;
rotationspeed = 0;
falling = false;
xVel = 0;
yVel = 0;
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <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>if(sbstate == 0) {
    yVel += 0.1;
    if (stun == 0) moveTo(xVel, yVel);
    alarm[0] = 1;
}
else {
    angleprevious = 0;
    direction = myangle;
    image_angle = direction;
    xVel = 0;
    yVel = 0;
    x=round(x);
    y=round(y);
    falling = false;
}
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="3" enumb="1">
      <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>enemy_active_check(20);
if (active == 1) instance_activate_region(x - 16, y - 16, 32, 32, 1);


if (room_width &lt;= 320) { // just in case we have flush rooms, we don't want them crawling outside
    if ((x &lt; (-(oControl.widescreen_space/2) - 8)) || (x &gt; (room_width + (oControl.widescreen_space/2) + 8)) || (y &lt; 0) || (y &gt; room_height)) {
        instance_destroy();
    }
}
</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>action_inherited();
if (active == 1 &amp;&amp; frozen == 0) {
    // movement
    if(!update) update = !update; // Run the movement code every other step, effectively resulting in 0.5 speed. 
    else {
        update = !update;
        sbstateprevious = sbstate;
        sbstate = 0;
        edgedl = position_meeting(x - 2, y + 1, oSolid);
        edgedr = position_meeting(x + 2, y + 1, oSolid);
        edgeul = position_meeting(x - 2, y - 2, oSolid);
        edgeur = position_meeting(x + 2, y - 2, oSolid);
        if (isCollisionBottom(0) == 1) y -= 1;
        if (isCollisionTop(0) == 1) y += 1;
        if (isCollisionLeft(0) == 1) x += 1;
        if (isCollisionRight(0) == 1) x -= 1;
        if (isCollisionBottom(1) == 1 &amp;&amp; isCollisionRight(1) == 0 &amp;&amp; isCollisionLeft(1) == 0) sbstate = 1;
        if (isCollisionRight(1) == 1 &amp;&amp; isCollisionBottom(1) == 0 &amp;&amp; isCollisionTop(1) == 0) sbstate = 2;
        if (isCollisionTop(1) == 1 &amp;&amp; isCollisionRight(1) == 0 &amp;&amp; isCollisionLeft(1) == 0) sbstate = 3;
        if (isCollisionLeft(1) == 1 &amp;&amp; isCollisionBottom(1) == 0 &amp;&amp; isCollisionTop(1) == 0) sbstate = 4;
        if (isCollisionBottom(1) == 1 &amp;&amp; isCollisionRight(1) == 1) sbstate = 5;
        if (isCollisionTop(1) == 1 &amp;&amp; isCollisionRight(1) == 1) sbstate = 6;
        if (isCollisionTop(1) == 1 &amp;&amp; isCollisionLeft(1) == 1) sbstate = 7;
        if (isCollisionBottom(1) == 1 &amp;&amp; isCollisionLeft(1) == 1) sbstate = 8;
        if (isCollisionBottom(1) == 0 &amp;&amp; isCollisionLeft(1) == 0 &amp;&amp; isCollisionRight(1) == 0 &amp;&amp; isCollisionTop(1) == 0) {
            if (edgedl == 1 &amp;&amp; edgeul == 0 &amp;&amp; edgeur == 0 &amp;&amp; edgedr == 0) sbstate = 9;
            if (edgeul == 1 &amp;&amp; edgedl == 0 &amp;&amp; edgeur == 0 &amp;&amp; edgedr == 0) sbstate = 10;
            if (edgeur == 1 &amp;&amp; edgedl == 0 &amp;&amp; edgeul == 0 &amp;&amp; edgedr == 0) sbstate = 11;
            if (edgedr == 1 &amp;&amp; edgedl == 0 &amp;&amp; edgeul == 0 &amp;&amp; edgeur == 0) sbstate = 12;
            if (edgedl == 1 &amp;&amp; edgeul == 0 &amp;&amp; edgeur == 0 &amp;&amp; edgedr == 1) sbstate = 1;
            if (edgedl == 0 &amp;&amp; edgeul == 0 &amp;&amp; edgeur == 1 &amp;&amp; edgedr == 1) sbstate = 2;
            if (edgedl == 0 &amp;&amp; edgeul == 1 &amp;&amp; edgeur == 1 &amp;&amp; edgedr == 0) sbstate = 3;
            if (edgedl == 1 &amp;&amp; edgeul == 1 &amp;&amp; edgeur == 0 &amp;&amp; edgedr == 0) sbstate = 4;
        }
        // falling
        if (sbstate == 0 &amp;&amp; falling == false) {
            falling = true;
            if(image_angle &gt; 270 || image_angle &lt; 90) xVel = 0.5 * facing;
            if(image_angle &gt; 90 &amp;&amp; image_angle &lt; 270) xVel = -0.5 * facing;
            alarm[0] = 1;
        }
        if (facing == 1 &amp;&amp; sbmove == 0) {
            if (sbstate == 1) sbmove = 1;
            if (sbstate == 3) sbmove = -1;
            if (sbstate == 5) sbmove = 1;
            if (sbstate == 6) sbmove = -1;
            if (sbstate == 7) sbmove = -1;
            if (sbstate == 8) sbmove = 1;
            if (sbstate == 9) sbmove = 1;
            if (sbstate == 10) sbmove = -1;
            if (sbstate == 11) sbmove = -1;
            if (sbstate == 12) sbmove = 1;
        }
        if (facing == -1 &amp;&amp; sbmove == 0) {
            if (sbstate == 1) sbmove = -1;
            if (sbstate == 3) sbmove = 1;
            if (sbstate == 5) sbmove = -1;
            if (sbstate == 6) sbmove = 1;
            if (sbstate == 7) sbmove = 1;
            if (sbstate == 8) sbmove = -1;
            if (sbstate == 9) sbmove = -1;
            if (sbstate == 10) sbmove = 1;
            if (sbstate == 11) sbmove = 1;
            if (sbstate == 12) sbmove = -1;
        }
        if (sbstate == 1) x += sbmove;
        if (sbstate == 2) y -= sbmove;
        if (sbstate == 3) x -= sbmove;
        if (sbstate == 4) y += sbmove;
        if (sbstate == 5) {
            if (sbmove == 1) y -= 1;
            if (sbmove == -1) x -= 1;
        }
        if (sbstate == 6) {
            if (sbmove == 1) x -= 1;
            if (sbmove == -1) y += 1;
        }
        if (sbstate == 7) {
            if (sbmove == 1) y += 1;
            if (sbmove == -1) x += 1;
        }
        if (sbstate == 8) {
            if (sbmove == 1) x += 1;
            if (sbmove == -1) y -= 1;
        }
        if (sbstate == 9) {
            if (sbmove == 1) y += 1;
            if (sbmove == -1) x -= 1;
        }
        if (sbstate == 10) {
            if (sbmove == 1) x -= 1;
            if (sbmove == -1) y -= 1;
        }
        if (sbstate == 11) {
            if (sbmove == 1) y -= 1;
            if (sbmove == -1) x += 1;
        }
        if (sbstate == 12) {
            if (sbmove == 1) x += 1;
            if (sbmove == -1) y += 1;
        }
    }
    // rotation
    switch (sbstate) {
        case 1: myangle = 0; break;
        case 2: myangle = 90; break;
        case 3: myangle = 180; break;
        case 4: myangle = 270; break;
    }
    var inst1 = collision_line(x-2, y, x+2, y, oSolid, false, true),
        inst2 = collision_line(x, y-2, x, y+2, oSolid, false, true),
        inst = noone; // -1 IS SELF YOU DIP
    if(instance_exists(inst1) &amp;&amp; string_pos("Slope", object_get_name(inst1.object_index))) inst = inst1;
    else if(instance_exists(inst2) &amp;&amp; string_pos("Slope", object_get_name(inst2.object_index))) inst = inst2;
    if(instance_exists(inst)) {
        if(string_pos("1",  object_get_name(inst.object_index))) myangle = 45;
        if(string_pos("2",  object_get_name(inst.object_index))) myangle = 315;
        if(string_pos("3",  object_get_name(inst.object_index))) myangle = 225;
        if(string_pos("4",  object_get_name(inst.object_index))) myangle = 135;
        if(string_pos("1B", object_get_name(inst.object_index))) myangle = 25;
        if(string_pos("2B", object_get_name(inst.object_index))) myangle = 334;
        if(string_pos("3B", object_get_name(inst.object_index))) myangle = 205;
        if(string_pos("4B", object_get_name(inst.object_index))) myangle = 154;
    }
    if(angleprevious != myangle) {
        rotationspeed = (abs(angle_difference(myangle, angleprevious))*15)/90;
        angleprevious = myangle;
    }
    if(falling == false) turn_towards_direction(myangle, rotationspeed);
    image_angle = direction;
    image_speed = 0.2;
    if (instance_number(oQuake) &gt; 0 &amp;&amp; falling == false) {
        if(image_angle &gt;= 90 &amp;&amp; image_angle &lt;= 270) {
            x = x + lengthdir_x(4, image_angle + 90);
            y = y + lengthdir_y(4, image_angle + 90);
        }
    }
} // if (active == 1 &amp;&amp; frozen == 0)
if (state == 100) enemy_death();
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="7" 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>/// dummied
</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>
