Skip to content

Terrafold selling farm #35

Description

@asl97

If one buys way too much farm, progress slows down to a crawl which sucks.

Since it allow us to put in negative number, why forbid it?

this.buyFarms = function() {
var toBuy = Number(document.getElementById('buyFarmAmount').value);
if(toBuy * 50 > this.land.soil) {
toBuy = Math.floor(this.land.soil/50);
}
if(toBuy <= 0) {
return;
}
this.land.soil -= toBuy * 50;
this.farms.addFarm(toBuy);
view.update();
};

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions