Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const int GAMEOVER_SPRITE_LINK_SPIN = 0; //lweapon sparkle
- const int GAMEOVER_SPRITE_WINKOUT = 0; //winkout sparkle
- const int GAMEOVER_SPRITE_MISC = 15;
- const int GAMEOVER_SPRITE_MISC_VAL = 9316.7810;
- const int GAMEOVER_SFX_CURSOR = 0;
- const int GAMEOVER_SFX_SELECTION = 0;
- const int GAMEOVER_SFX_LINKDEATH = 0;
- const int GAMEOVER_MAX_DEATHFRAME = 0;
- const int GAMEOVER_BLACK = 10;
- const int GAMEOVER_BG = 10;
- const int GAMEOVER_TEXT = 1;
- const int GAMEOVER_CURSOR_TILE = 1;
- const int GAMEOVER_CURSOR_X = 0;
- const int GAMEOVER_CURSOR_SAVE_Y = 0;
- const int GAMEOVER_CURSOR_DONTSAVE_Y = 0;
- const int GAMEOVER_TEXT_X = 0;
- const int GAMEOVER_TEXT_SAVE_Y = 0;
- const int GAMEOVER_TEXT_DONTSAVE_Y = 0;
- const int GAMEOVER_MIDI_SILENT = 0;
- const int GAMEOVER_MIDI = 0;
- const int GAMEOVER_LINKSPINTILE_FIRST = 0;
- const int GAMEOVER_LINKSPINTILE_LAST = 0;
- const int GAMEOVER_LINKSPINTILE_FRAMES_PER_TILE = 0;
- const int GAMEOVER_LINKSPINTILE_NUM_SPINS = 0;
- global script noF6
- {
- void run()
- {
- int quit = 0; int deathframe; bool cur_selection; int spinframes; int spinloops = GAMEOVER_LINKSPINTILE_NUM_SPINS;
- while(Link->HP > 0)
- {
- //This replaces your normal while(true) loop!
- //Function calls for that, go here!
- Waitdraw();
- Waitframe();
- }
- //standard game loop ended, so we're on Game Over.
- while(!quit)
- {
- //Set game music to a silent MIDI.
- Link->HP = 1;
- Link->Invisible = true;
- Link->CollDetection = false;
- //Clean up screen objects
- if ( Screen->NumNPCs() )
- {
- for ( int q = Screen->NumNPCs(); q > 0; --q )
- { npc n = Screen->LoadNPC(q); Remove(n); }
- }
- if ( Screen->NumLWeapons() )
- {
- for ( int q = Screen->NumLWeapons(); q > 0; --q )
- {
- lweapon n = Screen->LoadLWeapon(q);
- if ( n->Misc[GAMEOVER_SPRITE_MISC] != GAMEOVER_SPRITE_MISC_VAL ) { Remove(n); }
- }
- }
- if ( Screen->NumEWeapons() )
- {
- for ( int q = Screen->NumEWeapons(); q > 0; --q )
- { eweapon n = Screen->LoadEWeapon(q); Remove(n); }
- }
- if ( Screen->NumItems() )
- {
- for ( int q = Screen->NumItems(); q > 0; --q )
- { item n = Screen->LoadItem(q); Remove(n); }
- }
- //clear all ffcs
- for ( int q = 1; q < 33; ++q )
- {
- ffc f = Screen->LoadFFC(q);
- f->Data = 0; f->Script = 0;
- }
- //Do Link Death animation
- if ( deathframe == 0 ) Game->PlaySound( GAMEOVER_SFX_LINKDEATH );
- ++deathframe;
- lweapon sprite = Game->CreateLWeapon(LW_SPARKLE);
- sprite->UseSprite( GAMEOVER_SPRITE_LINK_SPIN );
- sprite->Misc[GAMEOVER_SPRITE_MISC] = GAMEOVER_SPRITE_MISC_VAL;
- if ( deathframe == 1 )
- {
- spinframes = sprite->deadstate;
- }
- while(sprite->isValid())
- {
- //Kill all inputs.
- if ( sprite->DeadState == 0 )
- {
- if ( spinloops > 0 )
- {
- sprite->DeadState = spinframes;
- --spinloops;
- }
- }
- Waitdraw(); Waitframe();
- }
- lweapon winkout = Screen->CreateLWeapon(LW_SPARKLE);
- winkout->UseSprite( GAMEOVER_SPRITE_WINKOUT );
- winkout->Misc[GAMEOVER_SPRITE_MISC] = GAMEOVER_SPRITE_MISC_VAL;
- while(winkout->isValid())
- {
- //Kill all inputs
- Waitdraw(); Waitframe();
- }
- //Play game over midi.
- //Draw black background with Quad()
- //Draw text SAVE / DON'T SAVE
- //Draw cursor, with SAVE as the default.
- cur_selection = true;
- if ( Link->PressDown || Link->PressUp )
- {
- cur_selection = !cur_selection; //flip its state
- Game->PlaySound( GAMEOVER_SFX_CURSOR );
- }
- if ( Link->PressStart )
- {
- Link->PressStart = false; Link->InputStart = false;
- Game->PlaySound( GAMEOVER_SFX_SELECTION );
- if ( cur_selection ) quit = 1;
- else quit = 2; //no save
- }
- Waitdraw(); Waitframe();
- }
- //The user has made a selection, so the quit loop is over.
- if ( quit == 1 )
- {
- Game->Save();
- Game->End();
- }
- else Game->End();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement