<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
  <spriteName>spr_bat_idle</spriteName>
  <solid>0</solid>
  <visible>-1</visible>
  <depth>-30</depth>
  <persistent>0</persistent>
  <parentName>obj_enemy_par</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>event_inherited();
state = STATE_SLEEP;
cooldown = 10;
life_max = 20;
life = life_max;
armor = 0;
damage = 30;

move_sp = 0.5;
max_sp = 1;
acc_sp = 1;
acc_vsp = 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>if (global.game_status != GAME_STATUS_PLAY) exit;

switch(state) {
  case STATE_MOVE:
    if (abs(hspd) &lt; max_sp)
      hspd += acc_sp * move_sp;
    if (acc_sp != 0) {
      image_xscale = sign(acc_sp);
    }
    image_speed = (hspd/4*image_xscale) * game_speed;
    vspd += acc_vsp * 0.2 * game_speed;
    
    if (cooldown &gt; 0) {
      cooldown = max(cooldown-game_speed, 0);
    }
    if (cooldown == 0) {
      acc_vsp = -acc_vsp;
      cooldown = 20;
    }
    
    x += hspd * game_speed;
    y += vspd * game_speed;
  break;
  case STATE_SLEEP:
    if (collision_rectangle(x-150, y-24, x+150, y+24, obj_char, false, true)) {
      state = STATE_MOVE;
      acc_sp = sign(obj_char.x-x);
      sprite_index = spr_bat_fly;
    }
  break;
}
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="7" enumb="11">
      <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 (irandom(99) &lt; 50) instance_create(x, y, obj_i_life);
audio_play_sound_on(global.snd_emitter, snd_explosion, false, 7);
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="7" enumb="10">
      <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>part_particles_create(global.prt_system, other.x, other.y, global.prt[PART_BULLET], 10);
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="7" 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>/// Nothing
</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>
