本帖最后由 sai90306 于 2012-4-19 14:38 编辑
吉井明久 发表于 2012-4-19 13:43
对啊。你看不是起到了打开开关就加二的效果了么?
可以举一反三么应用到你那个脚本里面嘛。 ...
我試著依照角色跟隨腳本的調用方式將腳本1改成這樣了...不知道對不對
class Game_Party def initialize # end def update if $doublespeed == true include Train_Actor_Game_Party_Module end end end class Game_Player def initialize # end def update if $doublespeed == true include Train_Actor_Game_Player_Module end end end class Spriteset_Map def initialize # end def update if $doublespeed == true include Train_Actor_Spriteset_Map_Module end end end class Scene_Map def initialize # end def update if $doublespeed == true include Train_Actor_Scene_Map_Module end end end
class Game_Party
def initialize
#
end
def update
if $doublespeed == true
include Train_Actor_Game_Party_Module
end
end
end
class Game_Player
def initialize
#
end
def update
if $doublespeed == true
include Train_Actor_Game_Player_Module
end
end
end
class Spriteset_Map
def initialize
#
end
def update
if $doublespeed == true
include Train_Actor_Spriteset_Map_Module
end
end
end
class Scene_Map
def initialize
#
end
def update
if $doublespeed == true
include Train_Actor_Scene_Map_Module
end
end
end
腳本2
class Game_Party def initialize # end def update if $doublespeed == true include Train_Actor_Game_Party_Module end end end class Game_Player def initialize # end def update if $doublespeed == true include Train_Actor_Game_Player_Module end end end class Spriteset_Map def initialize # end def update if $doublespeed == true include Train_Actor_Spriteset_Map_Module end end end class Scene_Map def initialize # end def update if $doublespeed == true include Train_Actor_Scene_Map_Module end end end
class Game_Party
def initialize
#
end
def update
if $doublespeed == true
include Train_Actor_Game_Party_Module
end
end
end
class Game_Player
def initialize
#
end
def update
if $doublespeed == true
include Train_Actor_Game_Player_Module
end
end
end
class Spriteset_Map
def initialize
#
end
def update
if $doublespeed == true
include Train_Actor_Spriteset_Map_Module
end
end
end
class Scene_Map
def initialize
#
end
def update
if $doublespeed == true
include Train_Actor_Scene_Map_Module
end
end
end
調用
$doublespeed=true $sss1=Game_Party.new $sss1.update $sss2=Game_Player.new $sss2.update $sss3=Spriteset_Map.new $sss3.update $sss4=Scene_Map.new $sss4.update
$doublespeed=true
$sss1=Game_Party.new
$sss1.update
$sss2=Game_Player.new
$sss2.update
$sss3=Spriteset_Map.new
$sss3.update
$sss4=Scene_Map.new
$sss4.update
不過在
def initialize
#
end
的地方不知道要填什麼?
因為我這樣寫雖然沒報錯
但調用後螢幕整個是黑的
想是因為initialize這裡沒東西的緣故吧?��� |