Question:
I got all of my code working but I don’t know how to make the candles go from one side to the other when you type in a number over 1. please help.
Link to code:
https://replit.com/@jackiboy787/Birthday-cake#index.html
or
code snippet:
while(true){
if(age == 1){
var candle = new Rectangle(10, 75);
candle.setPosition(pos1 , pos2);
candle.setColor("red");
add(candle);
break;
}else if(count == 0){
candle.setPosition(pos1 , pos2);
candle.setColor("red");
add(candle);
pos3 = pos1 +
count++;
}else{
candle.setPosition(pos3 , pos2);
candle.setColor("red");
add(candle);
count--;
}
break;
}