私はこのコードを持っています: http://jsfiddle.net/zyR9K/4/
var Enemies = {
x: 25,
y: 25,
width: 20,
height: 30,
speed: 0.5,
color: "#000",
draw: function () {
canvas.fillStyle = this.color;
canvas.fillRect(this.x+1, this.y, this.width, this.height);
},
update: function () {
this.y += this.speed
}
};
次のように見える複数の長方形を生成できるアルゴリズムを作成するのに少し問題があります。
誰でも私を助けることができますか?