-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgerms.map
1 lines (1 loc) · 9.46 KB
/
germs.map
1
{"version":3,"sources":["webpack:///webpack/bootstrap 298eb7253e59ccc9e6a8","webpack:///./js/game.js","webpack:///./js/objects.js","webpack:///./js/man.js","webpack:///./js/clicker.js","webpack:///./js/blank.js"],"names":[],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACtCA;AACA,wBAAuB,2BAA2B,qBAAqB,sBAAsB;AAC7F;AACA,eAAc,SAAS,aAAa;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA,eAAc,UAAU;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAc,qBAAqB;AACnC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AC9DA;AACA;;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AChEA,aAAY;;AAEZ;;AAEA;AACA;AACA;AACA,qBAAoB;AACpB,sBAAqB;AACrB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,2CAA0C;AAC1C;AACA;AACA;AACA,iBAAgB,qBAAqB;AACrC;AACA,6BAA4B,mCAAmC;AAC/D;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,iBAAgB,qBAAqB;AACrC;AACA;AACA;AACA;AACA,YAAW;AACX;AACA,YAAW;AACX;AACA;AACA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA,0BAAyB;AACzB;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;;;;;;AC9FA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA","file":"./holdfast.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 298eb7253e59ccc9e6a8\n **/","Window.newGame = function () {\n var initializeCanvas; var initializeKeyControls; var initializeWorld; var intervalFunction; var play;\n // 1. REQUIRE DEPENDENCIES\n var objects; var Man; var Clicker; var Blank;\n objects = require('./objects.js');\n Man = require('./man.js');\n Clicker = require('./clicker.js');\n Blank = require('./blank.js');\n\n // 2. INITIALIZE CANVAS\n initializeCanvas = function () {\n window.onload = function () {\n var canvas; var ctx;\n canvas = document.getElementById(\"canvas\");\n canvas.height = window.innerHeight;\n canvas.width = window.innerWidth;\n ctx = canvas.getContext('2d');\n this.canvas = canvas;\n this.ctx = ctx;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n }.bind(this);\n };\n\n // 3. INITIALIZE KEY CONTROLS\n initializeKeyControls = function (player) {\n };\n\n // 4. INITIALIZE WORLD\n initializeWorld = function () {\n var clicker; var ff;\n clicker = new Clicker(objects.length);\n clicker.init();\n objects.push(clicker);\n for (ff=0; ff < 300; ff++) {\n objects.push(new Man(objects.length, 100+Math.random()*650, 20+Math.pow((Math.random()*20), 2)));\n }\n objects.push(new Man(objects.length, 1000000, 1000000));\n };\n\n // 5. DEFINE INTERVAL FUNCTION\n intervalFunction = function () {\n var xx;\n ctx.fillStyle = '#667766';\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n for (xx=0; xx < objects.length; xx++) {\n if (objects[xx]) {\n objects[xx].draw(ctx);\n objects[xx].act();\n }\n }\n };\n\n // 5. PLAY\n play = function () {\n var interval; var xx;\n initializeWorld();\n interval = setInterval(intervalFunction, 32);\n };\n initializeCanvas();\n play();\n};\n\nWindow.newGame();\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./js/game.js\n ** module id = 0\n ** module chunks = 0\n **/","var objects = [];\nmodule.exports = objects;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./js/objects.js\n ** module id = 1\n ** module chunks = 0\n **/","var Man;\nMan = function (index, x, y) {\n this.index = index;\n this.name = 'man';\n this.moveSpeed = 2;\n this.active = false;\n this.color = '#bb0000';\n this.radius = 6;\n this.speed = {\n x: 0,\n y: 0,\n };\n this.pos = {\n x: x,\n y: y,\n };\n};\n\nMan.prototype.draw = function (ctx) {\n ctx.beginPath();\n ctx.arc(this.pos.x, this.pos.y, this.radius, 0, 2*Math.PI);\n ctx.fillStyle = this.color;\n ctx.fill();\n};\n\nMan.prototype.act = function () {\n this.pos.x += this.speed.x;\n this.pos.y += this.speed.y;\n this.color = this.active ? '#ee3333' : '#bb0000';\n};\n\nMan.prototype.goTo = function (dest) {\n this.moveTowards(dest);\n window.clearInterval(this.interval);\n this.interval = window.setInterval(function () {\n var xOff; var yOff;\n tempDest = {\n x: dest.x,\n y: dest.y,\n };\n xOff = (Math.random()*100)-50;\n yOff = (Math.random()*100)-50;\n tempDest.x += xOff;\n tempDest.y += yOff;\n this.moveTowards(tempDest);\n if (Math.abs(this.pos.x - dest.x) < xOff+8 && Math.abs(this.pos.y - dest.y) < yOff+8) {\n this.speed = {\n x: 0,\n y: 0,\n };\n window.clearInterval(this.interval);\n }\n }.bind(this), 1800-(Math.random()*1800));\n};\n\nMan.prototype.moveTowards = function (dest) {\n this.speed.x = -((this.pos.x - dest.x)/(Math.sqrt(\n Math.pow((this.pos.x - dest.x), 2) + Math.pow((this.pos.y - dest.y), 2)\n )/this.moveSpeed));\n this.speed.y = -((this.pos.y - dest.y)/(Math.sqrt(\n Math.pow((this.pos.x - dest.x), 2) + Math.pow((this.pos.y - dest.y), 2)\n )/this.moveSpeed));\n};\n\nmodule.exports = Man;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./js/man.js\n ** module id = 2\n ** module chunks = 0\n **/","var Clicker; var objects;\n\nobjects = require('./objects.js');\n\nClicker = function (index) {\n this.index = index;\n this.name = 'clicker';\n this.upperLeft = {x: 0, y: 0};\n this.lowerRight = {x: 0, y: 0};\n this.active = false;\n};\n\nClicker.prototype.init = function () {\n var isBetween;\n\n isBetween = function (checkPos, onePos, twoPos) {\n lesserX = onePos.x < twoPos.x ? onePos.x : twoPos.x;\n lesserY = onePos.y < twoPos.y ? onePos.y : twoPos.y;\n greaterX = onePos.x >= twoPos.x ? onePos.x : twoPos.x;\n greaterY = onePos.y >= twoPos.y ? onePos.y : twoPos.y;\n return (\n checkPos.x > lesserX &&\n checkPos.x < greaterX &&\n checkPos.y > lesserY &&\n checkPos.y < greaterY\n );\n };\n\n document.onmousedown = function (event) {\n if (event.button === 0) {\n this.active = true;\n this.upperLeft = this.lowerRight = {x: event.offsetX, y: event.offsetY};\n }\n if (event.ctrlKey || event.button === 2) {\n var oo;\n for (oo=0; oo < objects.length; oo++) {\n if (objects[oo] && objects[oo].name=='man' && objects[oo].active) {\n objects[oo].goTo({x: event.offsetX, y: event.offsetY});\n }\n }\n }\n }.bind(this);\n\n document.oncontextmenu = function (event) {\n return false;\n };\n\n document.onrightmousedown = function (event) {\n console.log('blast');\n }.bind(this);\n\n document.onmouseup = function (event) {\n var ii;\n if (event.button === 0) {\n this.active = false;\n for (ii=0; ii < objects.length; ii++) {\n if (objects[ii] && objects[ii].name === 'man') {\n if (isBetween({\n x:objects[ii].pos.x+objects[ii].radius/2,\n y:objects[ii].pos.y+objects[ii].radius/2\n }, this.lowerRight, this.upperLeft)) {\n objects[ii].active = true;\n } else {\n objects[ii].active = false;\n }\n }\n }\n }\n }.bind(this);\n\n document.onmousemove = function (event) {\n if (this.active) {\n this.lowerRight = {x: event.offsetX, y: event.offsetY};\n }\n }.bind(this);\n};\n\nClicker.prototype.draw = function (ctx) {\n if (this.active) {\n ctx.rect(\n this.upperLeft.x,\n this.upperLeft.y,\n this.lowerRight.x-this.upperLeft.x,\n this.lowerRight.y-this.upperLeft.y\n );\n ctx.strokeStyle = '#ffffff';\n ctx.stroke();\n }\n};\n\nClicker.prototype.act = function () {\n\n};\n\nmodule.exports = Clicker;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./js/clicker.js\n ** module id = 3\n ** module chunks = 0\n **/","var Blank;\nBlank = function (index) {\n this.index = index;\n this.name = 'blank';\n};\n\nBlank.prototype.draw = function (ctx) {\n};\n\nBlank.prototype.act = function () {\n};\n\nmodule.exports = Blank;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./js/blank.js\n ** module id = 4\n ** module chunks = 0\n **/"],"sourceRoot":""}