じ☆ve冰风 发表于 2026-8-1 17:32:34

Game Over +

Game Over +

by Todd (or DoctorTodd on RMRK)

Introduction

Adds an option window to the GameOver screen.

Features


[*]Plug and play

Screenshots



Demo

I don't think it's really necessary.

Script

Spoiler                Code:       
#===============================================================================
#
# DT's GameOver +
# Author: DoctorTodd
# Date (04/27/2012)
# Version: (1.0.0) (VXA)
# Level: (Simple)
# Email: Todd@beacongames.com
#
#===============================================================================
#
# NOTES: 1)This script will only work with ace.
#
#===============================================================================
#
# Description: Adds an option window to the GameOver screen.
#
# Credits: Me (DoctorTodd)
#
#===============================================================================
#
# Instructions
# Paste above main.
#
#===============================================================================
#
# Contact me for commercial use, other wise just credit me and don't repost
# without my permission.
#
#===============================================================================
#
# Editing begins 37 and ends on 41.
#
#===============================================================================
module DTGOP

#The Y coordinate of the Command Window
COMWINY = 300

#The X coordinate of the Command Window
COMWINX = 180

end
#==============================================================================
# ** Window_MenuCommand
#------------------------------------------------------------------------------
#This command window appears on the menu screen.
#==============================================================================

class Window_GameOverCommand < Window_Command
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
        super(0, 0)
end
#--------------------------------------------------------------------------
# * Get Window Width
#--------------------------------------------------------------------------
def window_width
        return 160
end
#--------------------------------------------------------------------------
# * Get Number of Lines to Show
#--------------------------------------------------------------------------
def visible_line_number
        item_max
end
#--------------------------------------------------------------------------
# * Create Command List
#--------------------------------------------------------------------------
def make_command_list
        add_load_command
        add_title_command
        add_original_commands
        add_quit_command
end
#--------------------------------------------------------------------------
# * Add load to Command List
#--------------------------------------------------------------------------
def add_load_command
   add_command("Load", :load)
end
#--------------------------------------------------------------------------
# * For Adding Original Commands
#--------------------------------------------------------------------------
def add_original_commands
end
#--------------------------------------------------------------------------
# * Add Title to Command List
#--------------------------------------------------------------------------
def add_title_command
        add_command("Title", :title)
end
#------------------------------------------------------------------------
# * Add quit Game to Command List
#--------------------------------------------------------------------------
def add_quit_command
        add_command("Shutdown", :quit)
end
end
#==============================================================================
# ** Scene_Gameover
#------------------------------------------------------------------------------
#This class performs game over screen processing.
#==============================================================================

class Scene_Gameover < Scene_Base
#--------------------------------------------------------------------------
# * Start Processing
#--------------------------------------------------------------------------
def start
        super
        play_gameover_music
        fadeout_frozen_graphics
        create_background
        create_command_window
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
        super
        dispose_background
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
        @command_window =Window_GameOverCommand.new
        @command_window.set_handler(:load,          method(:command_load))
        @command_window.set_handler(:title,       method(:command_title))
        @command_window.set_handler(:quit,          method(:command_quit))
        @command_window.y = (DTGOP::COMWINY)
        @command_window.x = (DTGOP::COMWINX)
        end
#--------------------------------------------------------------------------
# * Execute Transition
#--------------------------------------------------------------------------
def perform_transition
        Graphics.transition(fadein_speed)
end
#--------------------------------------------------------------------------
# * Play Music on Game Over Screen
#--------------------------------------------------------------------------
def play_gameover_music
        RPG::BGM.stop
        RPG::BGS.stop
        $data_system.gameover_me.play
end
#--------------------------------------------------------------------------
# * Fade Out Frozen Graphics
#--------------------------------------------------------------------------
def fadeout_frozen_graphics
        Graphics.transition(fadeout_speed)
        Graphics.freeze
end
#--------------------------------------------------------------------------
# * Create Background
#--------------------------------------------------------------------------
def create_background
        @sprite = Sprite.new
        @sprite.bitmap = Cache.system("GameOver")
end
#--------------------------------------------------------------------------
# * Free Background
#--------------------------------------------------------------------------
def dispose_background
        @sprite.bitmap.dispose
        @sprite.dispose
end
#--------------------------------------------------------------------------
# * Get Fade Out Speed
#--------------------------------------------------------------------------
def fadeout_speed
        return 60
end
#--------------------------------------------------------------------------
# * Get Fade In Speed
#--------------------------------------------------------------------------
def fadein_speed
        return 120
end
#--------------------------------------------------------------------------
# * Command
#--------------------------------------------------------------------------
def command_load
        SceneManager.call(Scene_Load)
end
#--------------------------------------------------------------------------
# * Command
#--------------------------------------------------------------------------
def command_title
        SceneManager.call(Scene_Title)
end
#--------------------------------------------------------------------------
# * Command
#--------------------------------------------------------------------------
def command_quit
        fadeout_all
        SceneManager.exit
end
end





FAQ

None right now.

Credit and Thanks

- Todd

Author's Notes

Free for non-commercial and commercial games. You must credit me! If you use this in a commercial game I expect a free copy.


本贴来自国际rpgmaker官方论坛作者:Todd处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/game-over.1719/
页: [1]
查看完整版本: Game Over +