I need to remove newCircle.fillColor = "red"; in order to get colors other than red but when i remove it, it says the property of hue is undefined.
var circles = [];
enter code here
function onKeyDown(event) {
var maxPoint = new Point(view.size.width, view.size.height);
var randomPoint = Point.random();
var point = maxPoint * randomPoint;
var newCircle = new Path.Circle(point,500)
if(event.key === "a"){
bubbles.play();
newCircle.fillColor = "#2c3e50";
}
else if(event.key === "b"){
newCircle.fillColor = "#2c3e50";
clay.play();
}
else if(event.key === "c"){
newCircle.fillColor = "#00ff0f";
confetti.play();
}
newCircle.fillColor = "red";
circles.push(newCircle);
}
function onFrame(event){
for(var i = 0; i < circles.length; i++){
circles[i].fillColor.hue += 1;
circles[i].scale(.9);
}
}
Aucun commentaire:
Enregistrer un commentaire