From 86aa0887d9294909edd159499d5f82200f8e3248 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20R=C3=BCmpelein?= Date: Mon, 29 Sep 2014 09:34:28 +0200 Subject: [PATCH] Small changes --- README.md | 5 ++++- src/jsds_crafty.js | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) 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); } } );