Reputation: 21
I'm trying to understand why my code isn't working. this is a piece of code that I'm creating for a game in canvas. I want to dynamically create an object to capture the radius, x and y coordinates. Eventually this will become a setInterval functon If i can get the console.log to produce I'll be good.
var i;
var circles = {};
for (i = 0; i>10; i++){
circles[i]= {
d:Math.floor(Math.random()*50),
x:Math.floor(Math.random()*500),
y:Math.floor(Math.random()*500)
};
console.log(circles[i].d, circles[i].x, circles[i].x);
};
Upvotes: 0
Views: 158