Skip to content

Commit

Permalink
adding a new function
Browse files Browse the repository at this point in the history
a new function has been added
  • Loading branch information
Steven Copeland committed Mar 10, 2017
1 parent 447ccf9 commit 6c99fa2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions JavaScript-Files/upgrades.js
Expand Up @@ -20,3 +20,15 @@ var buy = function(person) {
}
}
*/

var upgrades = function() {
if(me.money <= 100) {
var buy = prompt("You can buy some workers! How many would you like to buy?");
if(buy <= 0) {
alert("Its okay if you don't want buy any!");
}else if(buy >= 1) {
var spent = buy;
me.worker += spent
}
}
}

0 comments on commit 6c99fa2

Please sign in to comment.