diff --git a/README.md b/README.md index 02442b3..18ec2bd 100644 --- a/README.md +++ b/README.md @@ -1 +1,4 @@ -Simply game-helper for Dungeonslayers, written in HTML5 and JS \ No newline at end of file +Simply game-helper for Dungeonslayers, written in HTML5 and JS. + +All links are given from src-root, which makes it possible to run everything with some basic +HTTP-Server from this directory (i.e. 'python -m SimpleHTTPServer' or 'python -m http.server') \ No newline at end of file diff --git a/src/jsds_crafty.js b/src/jsds_crafty.js index 0ca7863..f73c788 100644 --- a/src/jsds_crafty.js +++ b/src/jsds_crafty.js @@ -77,7 +77,8 @@ (this.hit("coll")[0].overlap) ); } }); - + calc_center(); + /* Mouse-actions: * left click: select creature, save old position, make only this creature * controllable by mouse, write output info @@ -108,6 +109,10 @@ }); return this; + }, + calc_center: function() { + this.cx = this.x + (this.w / 2); + this.cy = this.y + (this.h / 2); } } );