I am pretty sure that the exported html file being large is (unfortunately) a given, since the Wick project file is just keeping data for the Wick Editor.
although the “repeating yourself in programming is bad” part is what I don’t get, so could you expound or clarify what you mean by that?
and with this one…
1. By initializing, do you mean like letting the objects start of with certain variables when beginning the game? if so you just place the stuff into the Default Script
.
2. FOR the second question (haha hehe ♫), a FOR loop simply repeats an action for every iteration… at least until the condition is false.
for (let i = 0; i < 10; i++){
let num = i + 1;
console.log("Wahoo! I am brother " + num);
}
/*which results in:
Wahoo! I am brother 1
Wahoo! I am brother 2
Wahoo! I am brother 3
Wahoo! I am brother 4
...
*/
It’s pretty efficient for doing things over and over and over again without repetitively typing it out, though you should probably be careful that the for loop will end at some point to prevent our browsers from crashing…
There are 3 parts to it within the parenthesis:
- the counter variable counts each iteration starting from… well… whatever value you start on.
- the Condition is self explanatory: it will keep running more iterations of the loop until it is false.
- the third part is run after each iteration of the loop, usually reserved for adding to the counter variable, although I have heard that you could theoretically place anything in there.
I believe that is all there is to it.