0

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);
};
asked Mar 5, 2012 at 6:57

1 Answer 1

4
for (i = 0; i>10; i++){

should be

for (i = 0; i<10; i++){
answered Mar 5, 2012 at 6:59
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.