Home > RGSS Script Reference > Scene_Gameover
Scene_Gameover
Inherits from: None
Description: This class handles the Game Over screen.
class Scene_Gameover
# ------------------------------------
def main
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.gameover($data_system.gameover_name)
$game_system.bgm_play(nil)
$game_system.bgs_play(nil)
$game_system.me_play($data_system.gameover_me)
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
# ------------------------------------
def update
if Input.trigger?(Input::C)
$scene = Scene_Title.new
end
end
end
|
Sprite: The sprite for the Game Over screen graphic.
Main
Arguments: None
Local Variables: None
How it Works: This is the main method for this class. The first part of the method sets up the picture that will be displayed. Then, the BGM and BGS are stopped, and the Game Over ME is played. The main loop is the loop you see in most "Scene" classes. It updates the graphics, checks for input, and updates the window contents repeatedly until the value of $Scene changes (the user has pressed "C" to return to the title screen). Once the scene changes, the rest of the method disposes of the bitmap.
Update
Arguments: None
Local Variables: None
How it Works: This method checks to see if the user has pressed "C" (decision key). If the player has, then the scene is changed to the title screen.
|
|