本帖最后由 kuerlulu 于 2015-7-16 19:44 编辑
本脚本需要 RMXP截图 作为前置脚本
使用时直接开始战斗就好了
# 增加开始战斗的特效 class Game_Temp attr_accessor :background_bitmap alias h150716_init initialize def initialize h150716_init @background_bitmap = Bitmap.new(640, 480) # Graphics.snap_to_bitmap end end class Scene_Map alias h150716_call_battle call_battle def call_battle $game_temp.background_bitmap.dispose $game_temp.background_bitmap = Graphics.snap_to_bitmap h150716_call_battle end end class Scene_Battle alias h150716_main main def main perform_shakalaka h150716_main end def perform_shakalaka @battleback_sprite = Sprite.new @battleback_sprite.bitmap=RPG::Cache.battleback($game_map.battleback_name) Graphics.transition(1) sprites = {} Array.new(20) do |x| Array.new(15) do |y| s = Sprite.new s.bitmap = $game_temp.background_bitmap s.src_rect = Rect.new(x * 32, y * 32, 32, 32) s.x, s.y = x * 32, y * 32 sprites[s] = [rand(15)+5,rand(15)+5,rand(20)+1,s.x>304 ? 1 : -1,s.y>256 ? 1 : -1] end end 45.times do sprites.each do |k, v| k.x += v[0] * v[3] k.y += v[1] * v[4] k.angle += v[2] end Graphics.update Input.update end Graphics.freeze @battleback_sprite.bitmap.dispose @battleback_sprite.dispose end end
# 增加开始战斗的特效
class Game_Temp
attr_accessor :background_bitmap
alias h150716_init initialize
def initialize
h150716_init
@background_bitmap = Bitmap.new(640, 480) # Graphics.snap_to_bitmap
end
end
class Scene_Map
alias h150716_call_battle call_battle
def call_battle
$game_temp.background_bitmap.dispose
$game_temp.background_bitmap = Graphics.snap_to_bitmap
h150716_call_battle
end
end
class Scene_Battle
alias h150716_main main
def main
perform_shakalaka
h150716_main
end
def perform_shakalaka
@battleback_sprite = Sprite.new
@battleback_sprite.bitmap=RPG::Cache.battleback($game_map.battleback_name)
Graphics.transition(1)
sprites = {}
Array.new(20) do |x|
Array.new(15) do |y|
s = Sprite.new
s.bitmap = $game_temp.background_bitmap
s.src_rect = Rect.new(x * 32, y * 32, 32, 32)
s.x, s.y = x * 32, y * 32
sprites[s] = [rand(15)+5,rand(15)+5,rand(20)+1,s.x>304 ? 1 : -1,s.y>256 ? 1 : -1]
end
end
45.times do
sprites.each do |k, v|
k.x += v[0] * v[3]
k.y += v[1] * v[4]
k.angle += v[2]
end
Graphics.update
Input.update
end
Graphics.freeze
@battleback_sprite.bitmap.dispose
@battleback_sprite.dispose
end
end
|