// This level is a place for making flower art.
// The real goal is to experiment and have fun!
// If you draw something with at least 1000 flowers, you will "succeed" at the level.
var pos = [];
pos[1] = {'x': 31, 'y': 106};
pos[2] = {'x': 64, 'y': 105};
pos[3] = {'x': 73, 'y': 100};
pos[3] = {'x': 93, 'y': 101};
pos[4] = {'x': 74, 'y': 61};
hero.drawCircle = function(x, y, size) {
var angle = 0;
hero.toggleFlowers(false);
while (angle <= Math.PI * 2) {
var newX = x + (size * Math.cos(angle));
var newY = y + (size * Math.sin(angle));
hero.moveXY(newX, newY);
hero.toggleFlowers(true);
angle += 0.2;
}
};
while (true) {
hero.drawCircle(pos, 10);
}
which is type ‘string’ not number
error at this part hero.moveXY(newX, newY);
this is already string.
*string var newX = x + (size * Math.cos(angle)); var newY = y + (size * Math.sin(angle));
// This level is a place for making flower art.
// The real goal is to experiment and have fun!
// If you draw something with at least 1000 flowers, you will "succeed" at the level.
var pos = [];
pos[0] = {'x': 31, 'y': 106};
pos[1] = {'x': 64, 'y': 105};
pos[2] = {'x': 73, 'y': 100};
pos[3] = {'x': 93, 'y': 101};
pos[4] = {'x': 74, 'y': 61};
hero.drawCircle = function(x, y, size) {
var angle = 0;
hero.toggleFlowers(false);
while (angle <= Math.PI * 2) {
var newX = x + (size * Math.cos(angle));
var newY = y + (size * Math.sin(angle));
hero.moveXY(newX, newY);
hero.toggleFlowers(true);
angle += 0.2;
}
};
while (true) {
for (var i = 0; i < pos.length; i ++) {
hero.drawCircle(pos[i], 10);
}
}
So here is the problem, now you know where the problem is and what this variable returns, now try to track it, why is it returning it as an object, how can you make it a number, based on what you already have.