Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Randomized GameOvers

I had thought of this yesterday, I was watching my friend play God of War II and we were making fun of the "You are Dead" Game Over screen I don't know how it lead to it, but I thought it would be cool to have a game with more than one game over screen.

Anyway, here's what I'm looking for:

I need a script that will randomly display the gameovers. So you have multiple game over screens in the folder, and every time you die, the game over screen will look different. It's just a simple randomization thing.

I was also thinking of one where the first time you died, it said "Game Over" then after about 3 more times, it said "Game Over (Again)" and so on...
 
I make this:

Code:
#===============================================================================
# Random Game Over
#===============================================================================
# by The Sleeping Leonhart
#===============================================================================

GAME_OVER_NAME = "GameOver" #Name of the game over picture
GAME_OVER_SOUND = "GameOver" #Name of the game over music
GAME_OVER_NUMBER = 3 #Number of game over

class Scene_Gameover
  def main
    @sprite = Sprite.new
    @number = rand(GAME_OVER_NUMBER)+1
    @sprite.bitmap = RPG::Cache.gameover(GAME_OVER_NAME+@number.to_s)
    $game_system.bgm_play(nil)
    $game_system.bgs_play(nil)
    Audio.me_play("Audio/Me/"+GAME_OVER_SOUND+@number.to_s)
    Graphics.transition(120)
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @sprite.bitmap.dispose
    @sprite.dispose
    Graphics.transition(40)
    Graphics.freeze
    if $BTEST
      $scene = nil
    end
  end
end

The script show different picture and play the relative sound.
For example:
If the script show the GameOver2 picture play the GameOver2 Sound.
 
Actually, you don't need a script. It helps, but there is another way.

Just make a parallel processing event that constantly changes the gameover at random. This is what I plan on doing with one of my dungeons with Battlebacks.

Of course, if you want the Gameover ME to change as well, then yeah, you'll need Sleeping Leonhart's script.
 
A quick question about the above script...

In Scene_Gameover there are 2 things defined (in the original version)
There is def update and def main.

But in the above script only def main is used... will this cause any problems?
DO you have to just edit the Scene_Gameover, or do you replace the entire thing?

Thanks,
Moriarty
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top