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

387 lines
10 KiB

<!--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>/* yes the trials menu uses a single obj and yes
it's probably not an optimal way of having a menu
i'll live my life how i want to */
audio_stop_sound(musTitle); // a fix so that the og main menu theme stops playing
scroll_x = 0; // background scrolling
cursor_blink = 0; // the visual cursor blinking
// cursor nudges used on the main menu
nudge_x = 0;
nudge_y = 0;
flavor_text = "Flavor text goes here"; // flavor_text used on the bottom of the screen
active = 1; // whether the menus are active
cat = 0; // category
sel = 0; // (cursor) selection
// course select variables
map_scroll = 0; // the course select scroll
real_scroll = 0; // the "real" scroll variable
// this is going to be a bit of a nightmare but be ready
available_maps = 0; // this variable will be important (trust me)
/*
for (var r1 = 0; r1 &lt; 3; ++r1;){ // start a for loop
// in this for loop you win
map_info[0,r1] = "Map "+string(r1); // name of the map
map_info[1,r1] = "Description not set. Pretend this says something really informative or something. Anyways, Shinx is a cool pokemon"; // description of the map
map_info[2,r1] = 3; // map tier 0-6 (0 basically nothing 6 being a nightmare)
map_info[3,r1] = -1; // personal PB
map_info[4,r1] = 42069; // developer PB
map_info[5,r1] = map0; // room goto
++available_maps; // add available_maps by one
}
THIS ISN'T IMPORTANT ANYMORE
*/
// and now that the failsafe is in let's go put info in
set_map_info("Test Room",0,"Delving into the code was a mistake",map0,-1);
set_map_info("First Steps",1,"Everyone has to start somewhere, right?",map1,-1);
set_map_info("The Tower",4,"Don't fall, that's not good for you",the_tower,-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>scroll_x += 0.2;
if (scroll_x &gt; 24) then scroll_x = 0;
// cursor blink
++cursor_blink;
if (cursor_blink &gt; 120) then cursor_blink = 0;
// nudge related
if (abs(nudge_x) &gt; 0){
nudge_x /= 1.6;
if (abs(nudge_x) &lt; 0.01) then nudge_x = 0;
}
if (abs(nudge_y) &gt; 0){
nudge_y /= 1.6;
if (abs(nudge_y) &lt; 0.01) then nudge_y = 0;
}
// all the menu stuffs
if (active){
switch (cat){
case 0: // main menu
if (oControl.kDown &amp;&amp; oControl.kDownPushedSteps == 0){
sfx_play(sndMenuMove);
nudge_y = 3;
switch (sel){
case 0:
sel = 2;
break;
case 1:
sel = 3;
break;
case 2:
sel = 0;
break;
case 3:
sel = 1;
break;
}
}
if (oControl.kUp &amp;&amp; oControl.kUpPushedSteps == 0){
sfx_play(sndMenuMove);
nudge_y = -3;
switch (sel){
case 0:
sel = 2;
break;
case 1:
sel = 3;
break;
case 2:
sel = 0;
break;
case 3:
sel = 1;
break;
}
}
if (oControl.kRight &amp;&amp; oControl.kRightPushedSteps == 0){
sfx_play(sndMenuMove);
nudge_x = 3;
switch (sel){
case 0:
sel = 1;
break;
case 1:
sel = 0;
break;
case 2:
sel = 3;
break;
case 3:
sel = 2;
break;
}
}
if (oControl.kLeft &amp;&amp; oControl.kLeftPushedSteps == 0){
sfx_play(sndMenuMove);
nudge_x = -3;
switch (sel){
case 0:
sel = 1;
break;
case 1:
sel = 0;
break;
case 2:
sel = 3;
break;
case 3:
sel = 2;
break;
}
}
if (oControl.kMenu1Pressed){
sfx_play(sndMenuSel);
switch (sel){
case 0:
cat = 1;
map_scroll = real_scroll;
break;
case 1:
room_change(trialeditor,0);
break;
case 2:
room_change(rm_options,0);
break;
case 3:
game_end();
break;
}
}
break;
case 1: // course select
var slast = sel;
if (oControl.kDown &amp;&amp; oControl.kDownPushedSteps == 0){
sfx_play(sndMenuMove);
++sel;
}
if (oControl.kUp &amp;&amp; oControl.kUpPushedSteps == 0){
sfx_play(sndMenuMove);
--sel;
}
if (sel &gt; available_maps-1) then sel = 0;
if (sel &lt; 0) then sel = available_maps-1;
if (oControl.kMenu1Pressed){
sfx_play(sndMenuSel);
global.trial_is = map_info[5,sel];
start_trial();
}
if (oControl.kMenu2Pressed){
sfx_play(sndMenuCancel);
cat = 0;
sel = 0;
}
break;
}
}
// flavor_textinator
flavor_text = "";
switch (cat){
case 0:
switch (sel){
case 0:
flavor_text = "Select a course and attempt to set a best time.";
break;
case 1:
flavor_text = "Play a tutorial on a specific ability.";
break;
case 2:
flavor_text = "Access AM2R's settings to tweak gameplay options.";
break;
case 3:
flavor_text = "Make like a tree and get out of here!"
break;
}
break;
}
// scrollinator
real_scroll = sel*10;
if (real_scroll &lt; 80) then real_scroll = 80;
if (real_scroll &gt; (available_maps*10)-80) then real_scroll = (available_maps*10)-80;
if (real_scroll &gt; map_scroll){ // greater than, add to map_scroll
map_scroll += (real_scroll-map_scroll)/2;
}
if (real_scroll &lt; map_scroll){ // less than, subtract from map_scroll
map_scroll -= (map_scroll-real_scroll)/2;
}
//if (abs(real_scroll-map_scroll) &lt; 0.125) then round(map_scroll); // round cap
</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>draw_set_alpha(1);
draw_background_tiled(bgMapScreenBG,scroll_x,0);
draw_set_color(c_black);
draw_set_alpha(0.3);
draw_rectangle(-100,0,420,240,false);
draw_set_alpha(1);
draw_set_font(fontGUI2Default);
draw_set_color(c_white);
// title
draw_set_halign(fa_center);
draw_text_border(160,5,"AM2R: Time Trials");
draw_text_border(160,15,"(this is a placeholder)");
/* align test
draw_set_halign(fa_left);
draw_text_border(20,5,"Align");
draw_set_halign(fa_right);
draw_text_border(300,5,"Align");
*/
switch (cat){
case 0: // main menu
// menu options
/*
draw_set_halign(fa_center);
cursor_blinking(sel,0);
draw_text_border(160,170,"Course Select");
cursor_blinking(sel,1);
draw_text_border(160,180,"Player Guides");
cursor_blinking(sel,2);
draw_text_border(160,190,"Options");
cursor_blinking(sel,3);
draw_text_border(160,200,"Quit Game");
*/
var cx = 160+nudge_x;
var cy = 120+nudge_y;
if (oControl.widescreen){
cursor_blinking(sel,0);
draw_sprite_ext(sTTButton169,0,cx-100,cy-30,1,1,0,draw_get_color(),1);
cursor_blinking(sel,1);
draw_sprite_ext(sTTButton169,1,cx+100,cy-30,1,1,0,draw_get_color(),1);
cursor_blinking(sel,2);
draw_sprite_ext(sTTButton169,2,cx-100,cy+72,1,1,0,draw_get_color(),1);
cursor_blinking(sel,3);
draw_sprite_ext(sTTButton169,3,cx+100,cy+72,1,1,0,draw_get_color(),1);
}else{// 4:3 buttons
cursor_blinking(sel,0);
draw_sprite_ext(sTTButton43,0,cx-75,cy-30,1,1,0,draw_get_color(),1);
cursor_blinking(sel,1);
draw_sprite_ext(sTTButton43,1,cx+75,cy-30,1,1,0,draw_get_color(),1);
cursor_blinking(sel,2);
draw_sprite_ext(sTTButton43,2,cx-75,cy+72,1,1,0,draw_get_color(),1);
cursor_blinking(sel,3);
draw_sprite_ext(sTTButton43,3,cx+75,cy+72,1,1,0,draw_get_color(),1);
}
break;
case 1: // course select
for (var r1 = 0; r1 &lt; available_maps; ++r1){
draw_set_font(fontGUI2Default);
cursor_blinking(sel,r1);
draw_set_halign(fa_left);
draw_text_border(20,(120+(r1*10))-map_scroll,string(map_info[0,r1]));
draw_set_font(fontMenuTinyDefault);
}
draw_set_color(c_white);
draw_set_halign(fa_right);
draw_text_border(300,180,string(map_info[1,sel]));
difficulty_string(map_info[2,sel]);
draw_set_color(c_white);
draw_text_border(300,200,"Best Time: "+time_string(map_info[3,sel]));
draw_set_color(c_yellow);
draw_text_border(300,210,"Dev Time: "+time_string(map_info[4,sel]));
break;
}
// lower bar
if (!flavor_text == ""){
draw_set_color(c_black);
draw_rectangle(-100,230,420,240,false);
draw_set_color(c_white);
draw_set_halign(fa_center);
draw_set_font(fontMenuSmallDefault);
draw_text(160,228,flavor_text);
}
</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>