diff --git a/assets/adv01/adv01.js b/assets/adv01/adv01.js index b1ca256..a871a57 100644 --- a/assets/adv01/adv01.js +++ b/assets/adv01/adv01.js @@ -16,7 +16,7 @@ var cur_sel; // "Pointer" to current selected creature var player={}; - /* iniitialize Players and creatures */ + /* initialize Players ("Player") and creatures ("Beast") */ player["Gesina"]=new Player({"pname":"Gesina", "cname":"Aknya", "class":"Zauberin", "level":0, "experience":0, "race":"Mensch", "size":2}, {"body":6, "agility":6, "spirit":8}, diff --git a/assets/style.css b/assets/style.css index 1751d63..72d3070 100644 --- a/assets/style.css +++ b/assets/style.css @@ -1,17 +1,8 @@ -body { - width: 800px; - margin: auto; - background: url('/assets/freielande.jpg') no-repeat 0 0, rgb(198,186,160); - background-size: 100% auto; - padding: 10px 0; -} - body>div { postion:relative; background: rgba(163,128,95,0.9); border-radius: 20px; padding: 5px 10px 5px 10px; - width: } h1 { @@ -36,9 +27,28 @@ h1 { } #load { - margin: 0px auto; + margin: 0px auto 5px auto; } #clear { clear: both; -} \ No newline at end of file +} + +/* Don't show anything but warning, if too small */ +@media all and (min-width: 800px) { + #small { + display:none; + } + body { + width: 800px; + margin: auto; + background: url('/assets/freielande.jpg') no-repeat 0 0, rgb(198,186,160); + background-size: 100% auto; + padding: 10px 0; + } +} +@media all and (max-width: 800px) { + #display { + display:none; + } +} diff --git a/index.html b/index.html index c000801..3881e76 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ -
+

JSDSH - Javascript Dungeonslayers Helper

@@ -18,6 +18,9 @@
+
+ Die Anzeige dieser Seite benötigt eine Breite von mindestens 800 px! +
diff --git a/src/jsds_crafty.js b/src/jsds_crafty.js index 0baaafe..36edf97 100644 --- a/src/jsds_crafty.js +++ b/src/jsds_crafty.js @@ -56,6 +56,8 @@ this.id=id || ""; this.h = h || 40; this.w = w || 40; + this.x = x || 0; + this.y = y || 0; this.thing(x,y,w,h,col) .collision() .fourway(4) @@ -77,7 +79,6 @@ (this.hit("coll")[0].overlap) ); } }); - calc_center(); /* Mouse-actions: * left click: select creature, save old position, make only this creature @@ -87,6 +88,7 @@ */ this.bind('MouseDown', function(e) { if(e.mouseButton === Crafty.mouseButtons.LEFT) { + this.calc_center(); this.old_pos["x"]=this.x; this.old_pos["y"]=this.y; Crafty("Creature").each( function() {