07-03-2009, 10:31 AM
Game Over Replacer + Enhancer
Version: 1
Version: 1
Introduction
Similar to Title Screen Replacer + Enhancer, this script changes the game over screen graphic to a new one of your choice. This script also allows developers to customise the look of their game over graphic by adjusting the tone, blend, positioning among other things.
Features
- Set game over graphic file name.
- Set graphic tone, blend, position, blurs, zoom, waves, angle, flip, etc..
Screenshots
Not photoshopped.
Demo
No demo.
Script
Code:
=begin
????????????????????????????????????????????????????????????????????????????????
? Game Over Screen Replacer + Enhancer ?
? Version 1 ?
? by PK8 ?
? July 3rd, 2009 ?
? http://rmvxp.com ?
????????????????????????????????????????????????????????????????????????????????
? ? Table of Contents ?
? ?? Author's Notes - Line 15?21 ?
? ?? Introduction & Description - Line 23?26 ?
? ?? Features - Line 28?30 ?
? ?? This aliases the following... - Line 32?35 ?
????????????????????????????????????????????????????????????????????????????????
? ? Author's Notes ?
? This is similar to my Title Screen Replacer + Enhancer script. Set the file ?
? name of the GameOver graphic and customise the look of the Game Over graphic.?
? ?
? You'll need a file named "GameOver.png" in your Graphics/System directory in ?
? order for this script to work whenever your project's encrypted and lacking ?
? in RTP Data. ?
????????????????????????????????????????????????????????????????????????????????
? ? Introduction & Description ?
? This script changes the game over screen graphic to a new one of your choice.?
? This script also allows developers to customise the look of their game over ?
? graphic by adjusting the tone, blend, positioning among other things. ?
????????????????????????????????????????????????????????????????????????????????
? ? Features ?
? ? Set game over graphic file name. ?
? ? Set graphic tone, blend, position, blurs, zoom, waves, angle, flip, etc.. ?
????????????????????????????????????????????????????????????????????????????????
? ? This aliases the following... ?
? update - Scene_Gameover ?
? create_gameover_graphic - Scene_Gameover ?
? dispose_gameover_graphic - Scene_Gameover ?
????????????????????????????????????????????????????????????????????????????????
=end
#===============================================================================
# ** Game Over Screen Replacer + Enhancer Customisation!
#-------------------------------------------------------------------------------
# Set the initial settings!
#===============================================================================
class PK8
# Game Over Screen Graphic file name? (Should be in Graphics/System)
GameOver = "GameOver.png"
# Graphic Tone? (Red, Green, Blue [-255 to 255], Grey [0 to 255])
GameOver_Tone = [0, 0, 0, 0]
# Graphic Position? (X, Y coordinates)
GameOver_Position = [0, 0]
# Graphic Zoom? (Width, Height) [100 denotes actual pixel size]
GameOver_Zoom = [100, 100]
# Blending (Type, Opacity, "Intensity")
GameOver_Blend = [0, 255, 0]
# Wave (Wave Amplitude, Wave Length [don't set it to 0], Wave Speed)
GameOver_Wave = [0, 0, 0]
# Set the angle of the graphic. (This is going to be tough to set up.)
GameOver_Angle = 0
# Flip graphic horizontally?
GameOver_Mirror = false
# Apply how much blur?
GameOver_Blur = 0
# Radial Blur (angle [0 to 360], division [2 to 100])
GameOver_RadialBlur = [0, 2]
end
#==============================================================================
# ** Scene_Gameover
#------------------------------------------------------------------------------
# This class performs game over screen processing.
#==============================================================================
class Scene_Gameover < Scene_Base
alias pk8_goe_update :update
alias pk8_goe_create_gameover_graphic :create_gameover_graphic
alias pk8_goe_dispose_gameover_graphic :dispose_gameover_graphic
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
pk8_goe_update
@bg.update
@sprite.update
end
#--------------------------------------------------------------------------
# * Create Game Over Graphic
#--------------------------------------------------------------------------
def create_gameover_graphic
pk8_goe_create_gameover_graphic
# Clearing @sprite bitmap and disposing sprite.
@sprite.bitmap.clear
@sprite.dispose
# Creating background (for blending purposes)
@bg = Sprite.new
@bg.bitmap = Cache.system(PK8::GameOver)
@bg.tone = Tone.new(PK8::GameOver_Tone[0], PK8::GameOver_Tone[1],
PK8::GameOver_Tone[2], PK8::GameOver_Tone[3])
@bg.x = PK8::GameOver_Position[0]
@bg.y = PK8::GameOver_Position[1]
@bg.zoom_x = PK8::GameOver_Zoom[0] * 0.01
@bg.zoom_y = PK8::GameOver_Zoom[1] * 0.01
@bg.color = Color.new(PK8::GameOver_Blend[2], PK8::GameOver_Blend[2],
PK8::GameOver_Blend[2], PK8::GameOver_Blend[1])
@bg.wave_amp = PK8::GameOver_Wave[0]
@bg.wave_length = PK8::GameOver_Wave[1]
@bg.wave_speed = PK8::GameOver_Wave[2]
@bg.angle = PK8::GameOver_Angle
@bg.mirror = PK8::GameOver_Mirror
PK8::GameOver_Blur.times do
@bg.bitmap.blur
end
@bg.bitmap.radial_blur(PK8::GameOver_RadialBlur[0],
PK8::GameOver_RadialBlur[1])
# Recreating sprite, bitmap and adding effects
@sprite = Sprite.new
@sprite.bitmap = Cache.system(PK8::GameOver)
@sprite.tone = Tone.new(PK8::GameOver_Tone[0], PK8::GameOver_Tone[1],
PK8::GameOver_Tone[2], PK8::GameOver_Tone[3])
@sprite.x = PK8::GameOver_Position[0]
@sprite.y = PK8::GameOver_Position[1]
@sprite.zoom_x = PK8::GameOver_Zoom[0] * 0.01
@sprite.zoom_y = PK8::GameOver_Zoom[1] * 0.01
@sprite.blend_type = PK8::GameOver_Blend[0]
@sprite.opacity = PK8::GameOver_Blend[1]
@sprite.wave_amp = PK8::GameOver_Wave[0]
@sprite.wave_length = PK8::GameOver_Wave[1]
@sprite.wave_speed = PK8::GameOver_Wave[2]
@sprite.angle = PK8::GameOver_Angle
@sprite.mirror = PK8::GameOver_Mirror
PK8::GameOver_Blur.times do
@sprite.bitmap.blur
end
@sprite.bitmap.radial_blur(PK8::GameOver_RadialBlur[0],
PK8::GameOver_RadialBlur[1])
end
#--------------------------------------------------------------------------
# * Dispose of Game Over Graphic
#--------------------------------------------------------------------------
def dispose_gameover_graphic
pk8_goe_dispose_gameover_graphic
@bg.bitmap.dispose
@bg.dispose
end
end
Instructions
Set up the script, starting at line 46. Also, create a GameOver.png and put it in your Graphics/System folder. This script won't work if your project is encrypted and is lacking RTP data.
FAQ
Awaiting question.
Compatibility
This aliases update, create_gameover_graphic and dispose_gameover_graphic of Scene_Gameover
Author's Notes
This is similar to my Title Screen Replacer + Enhancer script. Set the file name of the GameOver graphic and customise the look of the Game Over graphic.
Terms and Conditions
Exclusive to RMVXPUniverse.