本帖最后由 alexncf125 于 2022-7-8 21:27 编辑
class Scene_Gameover < Scene_Base #-------------------------------------------------------------------------- # ● 生成背景 #-------------------------------------------------------------------------- alias :create_different_background :create_background def create_background if $game_variables[1] == 0 create_different_background else @sprite = Sprite.new @sprite.bitmap = Cache.system("GameOver#{$game_variables[1]}") end end end
class Scene_Gameover < Scene_Base
#--------------------------------------------------------------------------
# ● 生成背景
#--------------------------------------------------------------------------
alias :create_different_background :create_background
def create_background
if $game_variables[1] == 0
create_different_background
else
@sprite = Sprite.new
@sprite.bitmap = Cache.system("GameOver#{$game_variables[1]}")
end
end
end
把图片命名成GameOver1, GameOver2, GameOver3...就能根据1号变量的值来切换图片 |