diff --git a/js/game.js b/js/game.js index 9617372..fb5c6cd 100644 --- a/js/game.js +++ b/js/game.js @@ -1,14 +1,25 @@ 'use strict'; (function () { + var loadJsonFile = function(filename) { + var res; + $.ajax({ + async: false, + url : filename, + success : function(data) { + res = data; + } + }); + return res; + } + var discoveries = loadJsonFile('json/discoveries.json'); + var workers = loadJsonFile('json/workers.json'); + + console.log(discoveries); + console.log(workers); var app = angular.module('particleClicker', []); })(); -var discoveries = [ - { - name: 'W-Boson', - description: 'Some nice description.' - } -]; + diff --git a/json/discoveries.json b/json/discoveries.json new file mode 100644 index 0000000..ba4b3f0 --- /dev/null +++ b/json/discoveries.json @@ -0,0 +1,11 @@ +[ + { + "name": "W-Boson", + "description": "The W-Boson is the carrier boson of the weak force.", + "research": { + "reputation": 1, + "cost": 100 + }, + "histogram": {} + } +] diff --git a/json/workers.json b/json/workers.json new file mode 100644 index 0000000..504768d --- /dev/null +++ b/json/workers.json @@ -0,0 +1,8 @@ +[ + { + "name": "PhD Student", + "description": "Basically a slave just with fewer rights.", + "loan": 100, + "rate": 1 + } +]