Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script_stage_main {
- let CSD = GetCurrentScriptDirectory();
- let bgm= CSD ~ ".\bgm.mp3";
- let count_push= 0;
- let MusicPlay= false;
- function wait(n) { loop(n) { yield; } }
- task StageTask {
- LoadMusic(bgm);
- wait(180);
- PlayMusic(bgm);
- MusicPlay= true;
- }
- function StopMusicWhereItIs(bgm) { }
- function PlayMusicWhereItWasBefore(bgm) { }
- @Initialize {
- StageTask;
- }
- @MainLoop {
- if(count_push==0) {
- if(Get_Key_State(VK_ESCAPE)==PUSH || Get_Key_State(VK_ESCAPE)==HOLD) {
- MusicPlay= false;
- StopMusicWhereItIs(bgm);
- count_push++;
- }
- /// redundant ?
- else if(Get_Key_State(VK_ESCAPE)==FREE) {
- MusicPlay= true;
- }
- }
- else if(count_push==1) {
- if(Get_Key_State(VK_ESCAPE)==PUSH || Get_Key_State(VK_ESCAPE)==HOLD) {
- PlayMusicWhereItWasBefore(bgm);
- MusicPlay= true;
- count_push++;
- }
- /// redundant ?
- else if(Get_Key_State(VK_ESCAPE)==FREE) {
- MusicPlay= false;
- }
- }
- else if(count_push==2) { count_push= 0; }
- yield;
- }
- @Finalize {
- FadeOut(bgm);
- DeleteMusic(bgm);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement