<!--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>back = 0;               // Sprite index
alpha = 1;              // Sprite transparency
phaseoffset = 0;        // Increased by phaserate every step to create wave movement 
phaserate = 1;          // Speed of wave movement
frequency = 50;         // Density of waves
amplitude = 5;          // Intensity of waves
offsetx = 100;          // Horizontal offset
offsety = 55;           // Vertical offset
speedx = 2.5;           // Horizontal speed
speedy = -0.5;          // Vertical speed
tr_offsetx = 0;         // Increased by speedx every step to create translation
tr_offsety = 0;         // Increased by speedy every step to create translation
sourcex = 0;
sourcey = 0;
effect = 0;             // 0: Sine, 1: VerComp, 2: HorComp (incomplete) 3: Sine+VerComp
scanline = 0;           // Scanline effect. 0: None, 1: Draw even lines, 2: Draw odd lines
width = view_wview[0];  // Width of screen port
height = view_hview[0]; // Height of screen port
image_speed = 0.1;      // Animation speed
surf = surface_create(room_width*2,room_height*2); // Background surface

//Debug
bgg = 0;
custom = 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>//Increase wave variables to create illusion of animation
phaseoffset += phaserate;
tr_offsetx += speedx;
tr_offsety += speedy;

//Draw tiled sprite to the background surface
if !surface_exists(surf){ surf=surface_create(room_width*2,room_height*2); }


</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="7" enumb="5">
      <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>//Free up resources
surface_free(surf);
</string>
          </argument>
        </arguments>
      </action>
    </event>
    <event eventtype="8" 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 alpha &gt; 0 { //Don't even bother drawing this shit if the background is invisible anyway
    surface_set_target(surf);
    draw_sprite_tiled_area(back,image_index,tr_offsetx,tr_offsety,0,0,room_width*2,room_height*2)
    surface_reset_target();

    var phase,step,fstep,istep,offx;
    fstep = (scanline == 2)
    istep = 1 + (scanline &gt; 0)
    
    if surface_exists(surf){ //Always make sure the surface is around
        for (var step=fstep; step&lt;width; step+=istep) {
            phase = sin(frequency*(step+phaseoffset)/height);
            if effect = 0 {
                //Sine
                offx = (((offsetx mod width)+width) mod width);
                sourcex = offx+sin(phase)*amplitude;
                sourcey = step+offsety;
                draw_surface_part_ext(surf,sourcex,sourcey,width,1,0,step,1,1,c_white,alpha);
            } else if effect = 1 {
                //Vert. Comp
                sourcex = 0;
                sourcey = offsety+step+sin(phase)*amplitude;
                draw_surface_part_ext(surf,sourcex,sourcey,width,1,0,step,1,1,c_white,alpha);
            } else if effect = 2 {
                //Horz. Comp (incomplete, weird effect)
                part = width-sourcex-8;
                sourcex = step+sin(phase)*amplitude+100;
                sourcey = 0
                draw_surface_part_ext(surf,sourcex,sourcey,width,1,0,step,1,1,c_white,alpha);
            } else if effect = 3 {
                //Sine + Vert. Comp (needs extra width)
                offx = (((offsetx mod width)+width) mod width);
                sourcex = offx+sin(phase)*amplitude;
                sourcey = offsety+step+sin(phase)*amplitude;
                part = width-sourcex;
                draw_surface_part_ext(surf,sourcex,sourcey,part,1,0,step,1,1,c_white,alpha);
            }
        }
    }
}
</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>
