当b=([[3],[4],[5],[6],[7]]) 那么a=(3,4,5,6,7)
b=([[3],[4],[5],[6],[7]])
a=Marshal::load(Marshal.dump(b))
x=544
for i in a
$game_screen.pictures.show("头像#{i}", 0,x, 550, 100, 100, 255, 0)
x-=87
end
你猜对了 结果是p出数字来了 就是a数组出不来undefined method show for未定义方法显示
b=([[3],[4],[5],[6],[7]])
c=Marshal::load(Marshal.dump(b))
a=c.flatten
p a #=> [3,4,5,6,7]
x=544
for i in a
$game_screen.pictures.show("头像#{i}", 0,x, 550, 100, 100, 255, 0)
x-=87
end
zlyl_wiley 发表于 2023-8-10 16:01
for i in 0...a.length
$game_screen.pictures.show("头像#{a}", 0,x, 550, 100, 100, 255, 0)
x-=87
这个方法可以了谢谢
b=([[3],[4],[5],[6],[7]])
c=Marshal::load(Marshal.dump(b))
a=c.flatten
#p a #=> [3,4,5,6,7]
x=544
for i in 0...a.length
$game_screen.pictures[i+1].show("头像#{a }", 0,x, 550, 100, 100, 255, 0)
x-=87
end
敌人ID是固定的
b=([[3],[4],[5],[6],[7]])
c=Marshal::load(Marshal.dump(b))
a=c.flatten
#p a #=> [3,4,5,6,7]
x=544
for i in 0...a.length
$game_screen.pictures[i+1].show("头像#{a }", 0,x, 550, 100, 100, 255, 0)
x-=87
end