<undefined> 0 -1 0 0 <undefined> <undefined> 1 603 7 0 0 -1 2 self 0 0 1 /* 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 < 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); 1 603 7 0 0 -1 2 self 0 0 1 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; 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; } } // 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 < 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 1 603 7 0 0 -1 2 self 0 0 1 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 < 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); } 0 0 0 0.5 0.100000001490116 0 0.100000001490116 0.100000001490116 0.200000002980232 -1 0