You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AM2R-TimeTrials/objects/oWaterFXV2.object.gmx

142 lines
5.0 KiB

<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
<spriteName>sEDBg2</spriteName>
<solid>0</solid>
<visible>-1</visible>
<depth>-500</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>FREQ = 8;
AMP = 2;
SPEED = 0.05;
THETA = 0;
y_bottom = y - view_yview[0];
if (y_bottom &lt; 0) y_bottom = 0;
if (y_bottom &gt; view_hview[0]) y_bottom = view_hview[0];
mysurf = surface_create(320 + (oControl.widescreen*oControl.widescreen_space), 240);
</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 (instance_exists(oWater)) {
y = global.waterlevel + oWater.yoffset;
} else if (instance_exists(oLavaSurface)) {
y = global.waterlevel;
}
y_top = y - view_yview[0];
y_top = clamp(y_top, 0, view_hview[0]);
y_bottom = view_hview[0];
THETA += SPEED;
if ((view_yview[0] + view_hview[0]) &gt;= y) {
if (!surface_exists(mysurf)) mysurf = surface_create(320 + (oControl.widescreen*oControl.widescreen_space), 240);
if (surface_exists(oControl.widescreen_surface)) {
surface_copy(mysurf, 0, 0, oControl.widescreen_surface);
} else if (surface_exists(application_surface)) {
surface_copy(mysurf, 0, 0, application_surface);
}
}
</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(surface_exists(mysurf)) {
global.wave_height = max(round(lerp(global.wave_height, floor((60-(fps-1))^1.5), 0.1)) - 1, 1); // Lower is smoother.
var height_top = min(y_bottom-y_top, global.wave_height);
if ((view_yview[0] + view_hview[0]) &gt;= y) {
for (yy = 0; yy &lt; 240; yy += global.wave_height) {
xx = AMP * sin(THETA + FREQ * yy / y_bottom);
if (yy &gt;= y_top) {
draw_surface_part_ext(mysurf, 0, yy, view_wview[0] + oControl.widescreen_space, global.wave_height, view_xview[0] + xx - (oControl.widescreen_space/2), view_yview[0] + yy, 1, 1, -1, 0.2);
if((yy-y_top) &lt; global.wave_height) draw_surface_part_ext(mysurf, 0, y_top, view_wview[0] + oControl.widescreen_space, yy-y_top, view_xview[0] + xx - (oControl.widescreen_space/2), view_yview[0] + y_top, 1, 1, -1, 0.2);
}
}
if(height_top &lt; global.wave_height) draw_surface_part_ext(mysurf, 0, y_top, view_wview[0] + oControl.widescreen_space, height_top, view_xview[0] + xx - (oControl.widescreen_space/2), y, 1, 1, -1, 0.2);
}
}
/*if ((view_yview[0] + view_hview[0]) &gt;= y) {
for (yy = 0; yy &lt; 240; yy += 1) {
xx = AMP * sin(THETA + FREQ * yy / y_bottom);
if (yy &gt;= y_top) {
if (surface_exists(mysurf)) draw_surface_part_ext(mysurf, 0, yy, view_wview[0], 1, view_xview[0] + xx, view_yview[0] + yy, 1, 1, -1, 0.2);
}
}
}
</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>-1</PhysicsObjectKinematic>
<PhysicsShapePoints/>
</object>