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.
467 lines
13 KiB
467 lines
13 KiB
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
|
|
<object>
|
|
<spriteName><undefined></spriteName>
|
|
<solid>0</solid>
|
|
<visible>-1</visible>
|
|
<depth>0</depth>
|
|
<persistent>0</persistent>
|
|
<parentName><undefined></parentName>
|
|
<maskName><undefined></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 */
|
|
|
|
draw_set_valign(fa_top);
|
|
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
|
|
|
|
// custom levels
|
|
custom_levels = 0;
|
|
// set up folders if they're not there
|
|
if (!directory_exists("stages/")){
|
|
directory_create("stages/");
|
|
}else{ // otherwise, dig in
|
|
var file = file_find_first("stages/*.am2rials",0);
|
|
if (file != ""){ // stages do exist!
|
|
get_stage_data(file);
|
|
var file = file_find_next();
|
|
while (file != ""){
|
|
get_stage_data(file);
|
|
var file = file_find_next();
|
|
}
|
|
}
|
|
}
|
|
|
|
// genuinely don't worry about any of this..
|
|
// 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 < 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 > 24) then scroll_x = 0;
|
|
|
|
// cursor blink
|
|
++cursor_blink;
|
|
if (cursor_blink > 120) then cursor_blink = 0;
|
|
// nudge related
|
|
if (abs(nudge_x) > 0){
|
|
nudge_x /= 1.6;
|
|
if (abs(nudge_x) < 0.01) then nudge_x = 0;
|
|
}
|
|
if (abs(nudge_y) > 0){
|
|
nudge_y /= 1.6;
|
|
if (abs(nudge_y) < 0.01) then nudge_y = 0;
|
|
}
|
|
|
|
// all the menu stuffs
|
|
if (active){
|
|
switch (cat){
|
|
case 0: // main menu
|
|
if (oControl.kDown && 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 && 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 && 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 && 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;
|
|
*/
|
|
cat = 2;
|
|
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 && oControl.kDownPushedSteps == 0){
|
|
sfx_play(sndMenuMove);
|
|
++sel;
|
|
}
|
|
if (oControl.kUp && oControl.kUpPushedSteps == 0){
|
|
sfx_play(sndMenuMove);
|
|
--sel;
|
|
}
|
|
if (sel > available_maps-1) then sel = 0;
|
|
if (sel < 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;
|
|
case 2:
|
|
if (oControl.kDownPushedSteps == 1 || (oControl.kDownPushedSteps >= 20 && oControl.kDownPushedSteps mod 4 == 1)){
|
|
sfx_play(sndMenuMove);
|
|
++sel;
|
|
}
|
|
if (oControl.kUpPushedSteps == 1 || (oControl.kUpPushedSteps >= 20 && oControl.kUpPushedSteps mod 4 == 1)){
|
|
sfx_play(sndMenuMove);
|
|
--sel;
|
|
}
|
|
if (sel > custom_levels-1) then sel = 0;
|
|
if (sel < 0) then sel = custom_levels-1;
|
|
if (oControl.kMenu1Pressed){
|
|
if (custom_levels == 0){
|
|
sfx_play(sndMenuCancel);
|
|
cat = 0;
|
|
sel = 0;
|
|
}else{
|
|
sfx_play(sndMenuSel);
|
|
global.level_is = custom_level_file[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 = "Create your own levels with the level editor.";
|
|
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 < 80) then real_scroll = 80;
|
|
if (real_scroll > (available_maps*10)-80) then real_scroll = (available_maps*10)-80;
|
|
if (real_scroll > map_scroll){ // greater than, add to map_scroll
|
|
map_scroll += (real_scroll-map_scroll)/2;
|
|
}
|
|
if (real_scroll < map_scroll){ // less than, subtract from map_scroll
|
|
map_scroll -= (map_scroll-real_scroll)/2;
|
|
}
|
|
//if (abs(real_scroll-map_scroll) < 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 (defunct)
|
|
for (var r1 = 0; r1 < 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;
|
|
case 2: // new course select
|
|
draw_set_halign(fa_center);
|
|
draw_set_color(c_white);
|
|
draw_text_border(160,30,string(custom_levels)+" levels found");
|
|
if (custom_levels){
|
|
/*an idea... make fake pages
|
|
this certainly wasn't designed for this but... i can clean it up later
|
|
*/
|
|
var push = floor(sel/14); // why why why why why
|
|
var push_max = floor((custom_levels-1)/14); // why why why why why
|
|
for (var i = 0+(push*14); i < 14+(push*14) ++i;){
|
|
if (i < custom_levels){
|
|
if (sel == i){
|
|
draw_text_border(160,60+((i-(push*14))*10),"> "+custom_level_name[i]+" by "+custom_level_auth[i]+" <");
|
|
}else{
|
|
draw_text_border(160,60+((i-(push*14))*10),custom_level_name[i]+" by "+custom_level_auth[i]);
|
|
}
|
|
}
|
|
}
|
|
draw_text_border(160-80,215,string(sel+1)+"/"+string(custom_levels));
|
|
draw_text_border(160+80,215,"Page: "+string(push+1)+"/"+string(push_max+1));
|
|
}else{
|
|
draw_text_border(160,110,"You don't have any lol");
|
|
draw_text_border(160,120,"Check AM2RDiscord for any levels that you like");
|
|
draw_text_border(160,130,"and put them within the following folder:");
|
|
draw_set_font(fontMenuTinyDefault);
|
|
draw_text_border(160,140,string_replace_all(game_save_id,"\","/")+"stages");
|
|
draw_set_font(fontGUI2Default);
|
|
}
|
|
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>
|