对于每个级别,都有一个坐标数组,我想根据这些坐标创建新实例。我想知道如何去做。这是我到目前为止所拥有的。
function levelDots(level){
var renderLevel = {
1: [(100, 100), (200, 200)], //not sure if this is correct, e.g (100, 100) would correspond to (x,y)
2: [(50,50), (75,75)]
}
renderLevel[level].each(function(){ //not sure what to put inbetween function()
dots.push(new dot(x,y))
});
}