clone 不可以,用了数组的方式
==================================================================
class Scene_Game2
def main
@d = [] #用数组统一建立多个类
for v in 0..1 #通过这里,我可以设置建立几个类
@d.push "a"+v.to_s #添加元素
@d[v]=Sprite.new #建立对象
@d[v].bitmap = Bitmap.new(800,600)#建立图层
@d[v].bitmap.fill_rect(0, 0, 32, 32, Color.new(240,200,64)) #
end
Graphics.transition(20)
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
@d[v].bitmap.dispose
@d[v].dispose
end
def update
if Input.trigger?(Input::C)
$scene = Scene_Map.new
end
if Input.trigger?(Input::DOWN)
@d[1].oy-=50
@d[0].oy-=100 #证明建立的两个类是否存在,严整后,是存在的
end
end
end