<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
  <spriteName>sprEnemy</spriteName>
  <solid>0</solid>
  <visible>-1</visible>
  <depth>0</depth>
  <persistent>0</persistent>
  <parentName>&lt;undefined&gt;</parentName>
  <maskName>sprPlayer</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>///Establecer variables

state = 1;
maxSpeed = 0;

lastHeardX = x;
lastHeardY = y;
originalX = x;
originalY = y;

llego = true;
</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>///movement alarm

   lastHeardX = originalX;
   lastHeardY = originalY;

</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>maxRadius = 0;

for(i = instance_number(objLightSource);i&gt;0;i--)
{
    current = instance_find(objLightSource,i);
    
    if(distance_to_object(current)&lt;=current.radius)
    {
        if(llego)
        {
            draw_set_colour(c_white);
            draw_text(x, y-20, "!");
            if(!audio_is_playing(sndAlert))audio_play_sound(sndAlert, 10, false);
        }
        
        if(maxSpeed &lt; 2)
        {
            maxSpeed += 0.5;
        }
        
        if((current.maxRadius &gt; maxRadius) &amp;&amp; (current.callsEnemies))
        {
            lastHeardX = current.x;
            lastHeardY = current.y;
        }
    }
}


llego = mp_potential_step(lastHeardX, lastHeardY, state * maxSpeed, false);
image_angle = direction;

if(llego)
{
    image_speed = 0;
    image_index = 5;
    alarm[0] = -1;
}
else
{
    image_speed = (maxSpeed / 10);
    if(alarm[0]==-1)alarm_set(0,600);
    
    if(!audio_is_playing(sndEnemyStep))
    audio_play_sound(sndEnemyStep, 10, false);
}

if(place_meeting(x,y,objPlayer))
{
    with(objPlayer)
    {
        instance_create(x, y, objPlayerDead);
        instance_destroy();
    }
    lastHeardX = originalX;
    lastHeardY = originalY;
}
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="8" enumb="64">
      <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>/*
draw_text(40, 20, lastHeardX);
draw_text(40, 40, lastHeardY);
*/
</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>
