ZoriaRPG

Game Over Screen for 2.54

May 11th, 2018
279
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const int DYING = 1;
  2. const int DEAD = 2;
  3. int frame;
  4. global script foo
  5. {
  6.      void run()
  7.      {
  8.           int quit = 0;
  9.           while(quit)
  10.           {
  11.                ++frame;
  12.                //stuff
  13.                if ( Link->HP <=0 )
  14.                {
  15.                     if ( LinkCanResurrect() )
  16.                     {
  17.                          //stuff that can refill life for one frame,
  18.                          //such as auto-refull systems, goes here
  19.                     }
  20.                     else quit = DYING;
  21.                }
  22.                Waitdraw();
  23.                //
  24.                Waitframe();
  25.           }
  26.           Link->HP = 1; Link->CollDetection = false;
  27.           //Screen  cleanup
  28.           Link->Action = LA_NONE;
  29.           for ( int q = Screen->NumNPCs(); q > 0; --q)
  30.           {
  31.                npc n = Screen->LoadNPC(q); n->Stun = 214747;
  32.           }
  33.           for ( int q = Screen->NumLWeapons(); q > 0; --q)
  34.           {
  35.                lweapon l = Screen->LoadLWeapon(q); Remove(l);
  36.           }
  37.           for ( int q = Screen->NumEWeapons(); q > 0; --q)
  38.           {
  39.                eweapon l = Screen->LoadEWeapon(q); Remove(l);
  40.           }
  41.           frame = 0;
  42.           while(quit)
  43.           {
  44.                
  45.                if ( quit ==  DYING )
  46.                {
  47.                     //Animation sequence of death
  48.                     Link->ScriptTile = DEATH_TILE + (frame / NUM_FRAMES_PER_TILE_IN_SEQUENCE );
  49.                     if ( frame >= NUM_FRAMES_IN_SEQUENCE )
  50.                     {
  51.                          frame = 0; quit = DEAD;
  52.                     }
  53.                }
  54.                if ( quit == DEAD )
  55.                {
  56.                     /*Game over screen, drawing backdrop
  57.                     text, and menu, goes here. */
  58.      
  59.                     /* choice to save, or quit. */
  60.                }
  61.                Waitdraw(); Waitframe();
  62.           }
  63.      }
  64. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×