Q:

for loop doesnt work very tick

basic incremental game javascript attempt blah blah http://igt.bitballoon.com/
timer var at top of code
var Timer = window.setInterval(function(){Tick()}, 1000);

My tick function
function Tick() {
    var persec = game.money;
    for (var i = 0; i < buildings.length; i++){
    persec += buildings[i].PerSec * buildings[i].Qty
}

the function that i want to work every tick but it does not
function Tick() {
    var persec = game.money;
    for (var i = 0; i < buildings.length; i++){
        persec += buildings[i].PerSec * buildings[i].Qty
    }
document.getElementById("money").innerHTML = persec;
}

the problem: it changes the persec value on the page when you buy a building and it adds the persec value to your money only once. it does not repeat every tick like it should. i had it working because with some bulky code but i dont want to add a new line for each building. i would prefer something like the for loop. so any help would be appreciated.
edit: website is not up to date sorry. didnt update it cause i wanted it to work first.

A:

Original
function Tick() {
    game.money += buildings[0].Qty * buildings[0].PerSec;
    game.money += buildings[1].Qty * buildings[1].PerSec;
    document.getElementById("money").innerHTML = game.money
}

Should be
function Tick() {
    buildings.forEach(function(building) {
        game.money += building.Qty * building.PerSec;  
    });
    document.getElementById("money").innerHTML = game.money;
}

