From 93c5e9d9c3aa37b0fbe5982a20a75b89599b65cc Mon Sep 17 00:00:00 2001 From: maylokana <88361930+maylokana@users.noreply.github.com> Date: Sun, 20 Mar 2022 01:37:16 -0500 Subject: [PATCH] TT menu & goal related logic going to have to clean this up later --- AM2R.project.gmx | 10 +++ Configs/Default.config.gmx | 2 +- objects/oSkipMain.object.gmx | 54 ++++++++++++++++ objects/oTTSpring.object.gmx | 2 +- objects/oTrialClear.object.gmx | 109 +++++++++++++++++++++++++++++++ objects/oTrialGoal.object.gmx | 6 +- objects/oTrialLogic.object.gmx | 32 ++++++++- objects/oTrialSelect.object.gmx | 111 ++++++++++++++++++++++++++++++-- rooms/initroom.room.gmx | 2 +- rooms/map0.room.gmx | 22 +++++-- rooms/titleroom.room.gmx | 1 + rooms/trialclearroom.room.gmx | 65 +++++++++++++++++++ rooms/trialselectroom.room.gmx | 3 +- scripts/goal_trial.gml | 3 + scripts/start_trial.gml | 2 +- sound/musTrialsMenu.sound.gmx | 29 +++++++++ sound/musTrialsWin.sound.gmx | 29 +++++++++ sprites/sTTButton169.sprite.gmx | 28 ++++++++ sprites/sTTButton43.sprite.gmx | 28 ++++++++ 19 files changed, 519 insertions(+), 19 deletions(-) create mode 100644 objects/oSkipMain.object.gmx create mode 100644 objects/oTrialClear.object.gmx create mode 100644 rooms/trialclearroom.room.gmx create mode 100644 sound/musTrialsMenu.sound.gmx create mode 100644 sound/musTrialsWin.sound.gmx create mode 100644 sprites/sTTButton169.sprite.gmx create mode 100644 sprites/sTTButton43.sprite.gmx diff --git a/AM2R.project.gmx b/AM2R.project.gmx index 2aecc8c..7c2ff63 100644 --- a/AM2R.project.gmx +++ b/AM2R.project.gmx @@ -1285,6 +1285,8 @@ sound\musCredits sound\musArea8 sound\musGenesis + sound\musTrialsMenu + sound\musTrialsWin sound\sndA4AlarmLoop @@ -3391,6 +3393,10 @@ sprites\sShipGlow + + sprites\sTTButton43 + sprites\sTTButton169 + background\bgScreenGuide @@ -4337,6 +4343,7 @@ + @@ -5384,6 +5391,7 @@ objects\oTrialSelect + objects\oTrialClear objects\oTrialGoal objects\oTrialLogic objects\oTrialAutoad @@ -5394,6 +5402,7 @@ objects\oTTSpring objects\oTTMissile objects\oTTSuper + objects\oSkipMain @@ -5820,6 +5829,7 @@ rooms\trialselectroom + rooms\trialclearroom rooms\map0 rooms\map1 diff --git a/Configs/Default.config.gmx b/Configs/Default.config.gmx index 3ba5b23..a5e86a0 100644 --- a/Configs/Default.config.gmx +++ b/Configs/Default.config.gmx @@ -220,7 +220,7 @@ false true 0 - AM2R + AM2R: Time Trials True 0 diff --git a/objects/oSkipMain.object.gmx b/objects/oSkipMain.object.gmx new file mode 100644 index 0000000..c4e8bc5 --- /dev/null +++ b/objects/oSkipMain.object.gmx @@ -0,0 +1,54 @@ + + + <undefined> + 0 + -1 + 0 + 0 + <undefined> + <undefined> + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + if (global.skip_mMenu == 1){ +audio_stop_all(); +if (global.results == 1){ +room_change(trialclearroom,0); +}else{ +room_change(trialselectroom,0); +} +} + + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/oTTSpring.object.gmx b/objects/oTTSpring.object.gmx index ba65c0f..9c99dd7 100644 --- a/objects/oTTSpring.object.gmx +++ b/objects/oTTSpring.object.gmx @@ -51,7 +51,7 @@ audio_stop_sound(sndMessage); sfx_play(sndMessage); make_notification("New Item","Spring Ball Acquired",140,"",""); -global.bomb = 1; +global.jumpball = 1; instance_destroy(); diff --git a/objects/oTrialClear.object.gmx b/objects/oTrialClear.object.gmx new file mode 100644 index 0000000..103c8f7 --- /dev/null +++ b/objects/oTrialClear.object.gmx @@ -0,0 +1,109 @@ + + + <undefined> + 0 + -1 + 0 + 0 + <undefined> + <undefined> + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + oControl.ingame = 0; +mus_change(musTrialsWin); + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + if (oControl.kMenu1Pressed){ +audio_stop_all(); +sfx_play(sndMenuMove); +room_change(trialselectroom,0); +} + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + // set up +draw_set_color(c_white); +draw_set_font(fontGUI2Default); +draw_set_halign(fa_center); + +// text +draw_text_border(160,50,"good job beating the course# +right now there isn't a proper clear# +screen so ignore this for now## +press your 'accept' menu button to# +go back to the main menu# +your time was "+time_string(global.end_time)); + + + + + + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/oTrialGoal.object.gmx b/objects/oTrialGoal.object.gmx index 6c3492f..2eb077d 100644 --- a/objects/oTrialGoal.object.gmx +++ b/objects/oTrialGoal.object.gmx @@ -48,9 +48,11 @@ 1 - mus_change(musItemAmb); + sfx_play(sndMessage); +mus_stop(oMusicV2.currentbgm); oTrialLogic.timer_started = -1; -goal_trial(); // the actual goal code +global.end_time = oTrialLogic.timer; +oTrialLogic.alarm[1] = 90; instance_destroy(); // done with this object so make it not exist diff --git a/objects/oTrialLogic.object.gmx b/objects/oTrialLogic.object.gmx index 7e5fc0f..83b5efc 100644 --- a/objects/oTrialLogic.object.gmx +++ b/objects/oTrialLogic.object.gmx @@ -25,12 +25,36 @@ 1 - visible = 0; // hide me! + global.clear = 0; +visible = 0; // hide me! // initially triallogic will merely act as a spawn point but does more than that alarm[0] = 1; // alarm for spawning samus // variables timer_started = 0; timer = 0; // in tics + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + goal_trial(); @@ -85,6 +109,12 @@ if (timer_started == 0) && !(oCharacter.state == 33){ mus_change(musEris); timer_started = 1; } + +if (keyboard_check(vk_alt)){ + room_speed = 6; +}else{ + room_speed = 60; +} diff --git a/objects/oTrialSelect.object.gmx b/objects/oTrialSelect.object.gmx index 9681540..2950922 100644 --- a/objects/oTrialSelect.object.gmx +++ b/objects/oTrialSelect.object.gmx @@ -29,8 +29,13 @@ 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 @@ -84,8 +89,18 @@ set_map_info(1,"First Steps",1,"Everyone has to start somewhere, right?",map1,-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){ @@ -93,22 +108,83 @@ switch (cat){ case 0: // main menu if (oControl.kDown && oControl.kDownPushedSteps == 0){ sfx_play(sndMenuMove); - ++sel; + 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); - --sel; + 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 (sel > 3) then sel = 0; -if (sel < 0) then sel = 3; if (oControl.kMenu1Pressed){ sfx_play(sndMenuSel); switch (sel){ case 0: cat = 1; - map_scroll = 80; - real_scroll = 80; + map_scroll = real_scroll; break; case 2: room_change(rm_options,0); @@ -222,6 +298,7 @@ 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"); @@ -231,6 +308,28 @@ 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){ diff --git a/rooms/initroom.room.gmx b/rooms/initroom.room.gmx index f975938..387d598 100644 --- a/rooms/initroom.room.gmx +++ b/rooms/initroom.room.gmx @@ -10,7 +10,7 @@ 0 0 -1 - + global.skip_mMenu = 0; -1 -1 0 diff --git a/rooms/map0.room.gmx b/rooms/map0.room.gmx index d28c2cf..b1f722c 100644 --- a/rooms/map0.room.gmx +++ b/rooms/map0.room.gmx @@ -10,7 +10,8 @@ 0 12632256 -1 - oMusicV2.currentbgm = musCaveAmbience; + // map0 functions as the test room. +oMusicV2.currentbgm = musCaveAmbience; -1 -1 -1 @@ -51,7 +52,7 @@ - + @@ -106,10 +107,21 @@ - - - + + + + + + + + + + + + + + 0 diff --git a/rooms/titleroom.room.gmx b/rooms/titleroom.room.gmx index 2fc0c20..e8ca73a 100644 --- a/rooms/titleroom.room.gmx +++ b/rooms/titleroom.room.gmx @@ -68,6 +68,7 @@ if (file_exists(working_directory + "\swap.ini")) file_delete(working_directory + 0 diff --git a/rooms/trialclearroom.room.gmx b/rooms/trialclearroom.room.gmx new file mode 100644 index 0000000..1530f20 --- /dev/null +++ b/rooms/trialclearroom.room.gmx @@ -0,0 +1,65 @@ + + + + 320 + 240 + 32 + 32 + 0 + 60 + 0 + 1118481 + -1 + + -1 + -1 + -1 + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 0 + 0 + 1024 + 768 + 0 + 10 + 0.100000001490116 + diff --git a/rooms/trialselectroom.room.gmx b/rooms/trialselectroom.room.gmx index 3a9fd37..15d65a2 100644 --- a/rooms/trialselectroom.room.gmx +++ b/rooms/trialselectroom.room.gmx @@ -10,7 +10,8 @@ 0 8421504 -1 - mus_loop(musItemAmb); + global.skip_mMenu = 1; // skip the main menu after going to it once +mus_loop(musTrialsMenu); -1 -1 -1 diff --git a/scripts/goal_trial.gml b/scripts/goal_trial.gml index 19bbcbb..94c1f36 100644 --- a/scripts/goal_trial.gml +++ b/scripts/goal_trial.gml @@ -1 +1,4 @@ // goal_trial() +remove_persistent_objects(); +global.ingame = 0; +room_change(trialclearroom,0); diff --git a/scripts/start_trial.gml b/scripts/start_trial.gml index 535b55f..04e277a 100644 --- a/scripts/start_trial.gml +++ b/scripts/start_trial.gml @@ -13,4 +13,4 @@ global.mapoffsetx = 5; global.myposy = 5; global.mapoffsety = 5; // don't worry about it -room_goto(room_); // go to the room designated by the var +room_change(room_,0); // go to the room designated by the var diff --git a/sound/musTrialsMenu.sound.gmx b/sound/musTrialsMenu.sound.gmx new file mode 100644 index 0000000..2de0ceb --- /dev/null +++ b/sound/musTrialsMenu.sound.gmx @@ -0,0 +1,29 @@ + + + 3 + .ogg + sound\audio\musTrialsMenu.ogg + 0 + + 1 + + 0 + + 192 + + + 44100 + + + 1 + + + 16 + + -1 + musTrialsMenu.ogg + 1 + 1 + 0 + 0 + diff --git a/sound/musTrialsWin.sound.gmx b/sound/musTrialsWin.sound.gmx new file mode 100644 index 0000000..03458b7 --- /dev/null +++ b/sound/musTrialsWin.sound.gmx @@ -0,0 +1,29 @@ + + + 3 + .ogg + sound\audio\musTrialsWin.ogg + 0 + + 1 + + 0 + + 192 + + + 44100 + + + 1 + + + 16 + + -1 + musTrialsWin.ogg + 1 + 1 + 0 + 0 + diff --git a/sprites/sTTButton169.sprite.gmx b/sprites/sTTButton169.sprite.gmx new file mode 100644 index 0000000..08dff21 --- /dev/null +++ b/sprites/sTTButton169.sprite.gmx @@ -0,0 +1,28 @@ + + + 0 + 95 + 49 + 1 + 0 + 0 + 0 + 0 + 189 + 0 + 97 + 0 + 0 + + 0 + + 0 + 190 + 98 + + images\sTTButton169_0.png + images\sTTButton169_1.png + images\sTTButton169_2.png + images\sTTButton169_3.png + + diff --git a/sprites/sTTButton43.sprite.gmx b/sprites/sTTButton43.sprite.gmx new file mode 100644 index 0000000..d6b8a81 --- /dev/null +++ b/sprites/sTTButton43.sprite.gmx @@ -0,0 +1,28 @@ + + + 0 + 70 + 49 + 1 + 0 + 0 + 0 + 0 + 139 + 0 + 97 + 0 + 0 + + 0 + + 0 + 140 + 98 + + images\sTTButton43_0.png + images\sTTButton43_1.png + images\sTTButton43_2.png + images\sTTButton43_3.png + +