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/oGotoRoom.object.gmx

157 lines
7.0 KiB

<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
<spriteName>sEDGoto</spriteName>
<solid>0</solid>
<visible>0</visible>
<depth>-200</depth>
<persistent>0</persistent>
<parentName>&lt;undefined&gt;</parentName>
<maskName>&lt;undefined&gt;</maskName>
<events>
<event eventtype="3" enumb="2">
<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 ((direction == 0 || direction == 180) &amp;&amp; oCharacter.y &lt;= y + 8 &amp;&amp; oCharacter.y &gt; y - height - 8 || (direction == 90 || direction == 270) &amp;&amp; oCharacter.x &gt;= x &amp;&amp; oCharacter.x &lt; x + height) {
if (direction == 0 &amp;&amp; oCharacter.x &gt; x - 4 &amp;&amp; oCharacter.x &lt; x + 16 || direction == 180 &amp;&amp; oCharacter.x &lt; x + 4 &amp;&amp; oCharacter.x &gt; x - 16 || direction == 90 &amp;&amp; oCharacter.y &lt; y + 4 &amp;&amp; oCharacter.y &gt; y - 16 || direction == 270 &amp;&amp; oCharacter.y &gt; y - 4 &amp;&amp; oCharacter.y &lt; y + 16) {
global.targetx = targetx;
global.targety = targety;
global.camstartx = camstartx;
global.camstarty = camstarty;
oCamera.x = global.camstartx;
oCamera.y = global.camstarty;
if (direction == 0 || direction == 180) {
global.offsety = oCharacter.y - y;
global.offsetx = 0;
}
if (direction == 90 || direction == 270) {
global.offsetx = oCharacter.x - x;
global.offsety = 0;
}
global.transitiontype = 1;
global.transitionx = transitionx + global.offsetx;
global.transitiony = transitiony + global.offsety;
with (oCharacter) {
x -= view_xview[0];
y -= view_yview[0];
visible = false;
}
// Widescreen
if (global.widescreen_enabled) {
oControl.widescreen_space = 106;
var targetwidth;
// Edge case rooms
switch (targetroom) {
case rm_a3a20: // Zig-zag room
case rm_a7c01: // Egg room
case rm_a6b13: // Nest vertical shaft
case rm_a2a07: targetwidth = 320; break; // Varia
case rm_a3a01: { // Torizo
if (global.event[152] &gt; 0) {
targetwidth = ds_map_find_value(oControl.room_width_map, targetroom); // after torizo
} else {
targetwidth = 320; // before torizo
}
break;
}
default: targetwidth = ds_map_find_value(oControl.room_width_map, targetroom); break;
}
if (targetwidth &gt; 320) {
if (targetx &lt;= 320)
global.transitionx -= oControl.widescreen_space/2 - max(0, ((oControl.widescreen_space + 320)) - targetwidth)/2;
else if (targetx &gt;= targetwidth-320)
global.transitionx += oControl.widescreen_space/2 - max(0, ((oControl.widescreen_space + 320)) - targetwidth)/2;
else {
if(camstartx &lt;= floor(oControl.widescreen_space/2)+160)
global.transitionx -= max(0, floor(oControl.widescreen_space/2) - 320);
if(camstartx &gt;= abs(floor((oControl.widescreen_space/2)+160) - targetwidth))
global.transitionx += max(0, floor(oControl.widescreen_space/2) - 320);
}
}
}
if (global.widescreen_enabled != oControl.widescreen) oControl.widescreen_switch = true;
oControl.mod_previous_room = room;
room_change(targetroom, 1);
Mute_Loops();
StopAmbLoops();
}
}
/*if ((direction == 0 || direction == 180) &amp;&amp; oCharacter.y &lt;= y + 8 &amp;&amp; oCharacter.y &gt; y - height - 8 || (direction == 90 || direction == 270) &amp;&amp; oCharacter.x &gt;= x &amp;&amp; oCharacter.x &lt; x + height) {
if (direction == 0 &amp;&amp; oCharacter.x &gt; x - 4 &amp;&amp; oCharacter.x &lt; x + 16 || direction == 180 &amp;&amp; oCharacter.x &lt; x + 4 &amp;&amp; oCharacter.x &gt; x - 16 || direction == 90 &amp;&amp; oCharacter.y &lt; y + 4 &amp;&amp; oCharacter.y &gt; y - 16 || direction == 270 &amp;&amp; oCharacter.y &gt; y - 4 &amp;&amp; oCharacter.y &lt; y + 16) {
global.targetx = targetx;
global.targety = targety;
global.camstartx = camstartx;
global.camstarty = camstarty;
oCamera.x = global.camstartx;
oCamera.y = global.camstarty;
if (direction == 0 || direction == 180) {
global.offsety = oCharacter.y - y;
global.offsetx = 0;
}
if (direction == 90 || direction == 270) {
global.offsetx = oCharacter.x - x;
global.offsety = 0;
}
global.transitiontype = 1;
global.transitionx = transitionx + global.offsetx;
global.transitiony = transitiony + global.offsety;
with (oCharacter) {
x -= view_xview[0];
y -= view_yview[0];
visible = false;
}
oControl.mod_previous_room = room;
room_change(targetroom, 1);
Mute_Loops();
StopAmbLoops();
} // if (direction == 0 &amp;&amp; oCharacter.x &gt; x - 4 &amp;&amp; oCharacter.x &lt; x + 16 || direction == 180 &amp;&amp; oCharacter.x &lt; x + 4 &amp;&amp; oCharacter.x &gt; x - 16 || direction == 90 &amp;&amp; oCharacter.y &lt; y + 4 &amp;&amp; oCharacter.y &gt; y - 16 || direction == 270 &amp;&amp; oCharacter.y &gt; y - 4 &amp;&amp; oCharacter.y &lt; y + 16)
} // if ((direction == 0 || direction == 180) &amp;&amp; oCharacter.y &lt;= y + 8 &amp;&amp; oCharacter.y &gt; y - height - 8 || (direction == 90 || direction == 270) &amp;&amp; oCharacter.x &gt;= x &amp;&amp; oCharacter.x &lt; x + height)
</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>