Skip to content
This repository has been archived by the owner on Jun 21, 2019. It is now read-only.

Commit

Permalink
temp commit
Browse files Browse the repository at this point in the history
  • Loading branch information
anand-bala committed Oct 6, 2017
1 parent 4b1d772 commit 7461cd7
Show file tree
Hide file tree
Showing 8 changed files with 766 additions and 66 deletions.
127 changes: 127 additions & 0 deletions debug.json
@@ -0,0 +1,127 @@
{
"obj": 1729.489604773147,
"left": {
"obj": 1570.6822726077785,
"left": null,
"right": null,
"parent": null,
"dimension": 1
},
"right": {
"obj": [2385.102766951694, 1542.5564272168579],
"left": null,
"right": {
"obj": [2183.1271849742398, 566.6155794636488],
"left": null,
"right": {
"obj": [666.1790129700837, 1349.8717660895397],
"left": null,
"right": {
"obj": [2770.1318133942113, 964.4800730511855],
"left": null,
"right": {
"obj": [3079.2789987998194, 1464.8076915317822],
"left": null,
"right": {
"obj": [1200.6003568597544, 909.5299696564497],
"left": null,
"right": {
"obj": [3173.730600231665, 1561.4672491016313],
"left": null,
"right": {
"obj": [2932.6860613670096, 492.9232982528555],
"left": null,
"right": {
"obj": [3169.6267281324144, 948.9368680975821],
"left": null,
"right": {
"obj": [599.4303554445063, 1002.4248536171333],
"left": null,
"right": {
"obj": [169.6907147348701, 981.0591355278727],
"left": null,
"right": {
"obj": [199.6274372765478, 270.9441759243511],
"left": null,
"right": {
"obj": [1403.4701125604033, 119.66427293487159],
"left": null,
"right": {
"obj": [844.7653859820242, 392.8774207215394],
"left": null,
"right": {
"obj": [1700.5356627952337, 445.68325711600954],
"left": null,
"right": {
"obj": [155.42199589185785, 646.464030934631],
"left": null,
"right": {
"obj": [1114.3454986231345, 161.2857050777256],
"left": null,
"right": {
"obj": [1998.0816484316601, 791.249363752577],
"left": null,
"right": {
"obj": [1194.565046765439, 655.391014794564],
"left": null,
"right": null,
"parent": null,
"dimension": 1
},
"parent": null,
"dimension": 0
},
"parent": null,
"dimension": 1
},
"parent": null,
"dimension": 0
},
"parent": null,
"dimension": 1
},
"parent": null,
"dimension": 0
},
"parent": null,
"dimension": 1
},
"parent": null,
"dimension": 0
},
"parent": null,
"dimension": 1
},
"parent": null,
"dimension": 0
},
"parent": null,
"dimension": 1
},
"parent": null,
"dimension": 0
},
"parent": null,
"dimension": 1
},
"parent": null,
"dimension": 0
},
"parent": null,
"dimension": 1
},
"parent": null,
"dimension": 0
},
"parent": null,
"dimension": 1
},
"parent": null,
"dimension": 0
},
"parent": null,
"dimension": 1
},
"parent": null,
"dimension": 0
}
7 changes: 7 additions & 0 deletions src/app/entity/Entity.js
Expand Up @@ -287,6 +287,13 @@ Entity.prototype.toString = function() {
return (results && results.length > 1) ? results[1] : '';
};

Entity.prototype.centerXY = function() {
let tmp = {};
tmp.x = this.centerX;
tmp.y = this.centerY;
return tmp;
};

/**
* Entity module.
* @module: entity/Entity
Expand Down
2 changes: 2 additions & 0 deletions src/app/factory/Factory.js
@@ -1,4 +1,5 @@
'use strict';
const Map = require('../util/Map');

/**
*
Expand Down Expand Up @@ -38,6 +39,7 @@ Factory.prototype.next = function(x, y, key) {
this.group.add(sprite);
sprite.setDirection(Math.floor(Math.random() * 4) + 1);
sprite.idleHere();
Map.insert(sprite.centerXY());
return sprite;
};

Expand Down
1 change: 1 addition & 0 deletions src/app/lib/kdtreejs/.gitignore
@@ -0,0 +1 @@
.DS_Store
19 changes: 19 additions & 0 deletions src/app/lib/kdtreejs/LICENCE
@@ -0,0 +1,19 @@
Copyright (c) 2012 Ubilabs

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

0 comments on commit 7461cd7

Please sign in to comment.