I am completing the project: https://googlecreativelab.github.io/coder-projects/projects/pop_up_penguins/ which allows a user to click on 8 penguins within a page. However i'm trying to populate the page in javascript rather than html such that a player can easily adjust the number of penguins within the game.
I was thinking to first build an array from some user selected number.
penguinarray[count];
Then use a for loop to repeatedly place each penguin based on the size of the array.
for(var i = 0; i < penguinarray.length; i++) {
document.createElement("penguin1");
}
Im not sure however how I can still randomize all the different types of penguins and the snow mounds from the 8 available, or allow the page to change given a different number of penguins.
See Question&Answers more detail:os