Self-Attacks now forbidden
This commit is contained in:
parent
a9c7f04230
commit
e090551214
2 changed files with 9 additions and 1 deletions
|
@ -10,6 +10,8 @@
|
||||||
<div id="game"></div>
|
<div id="game"></div>
|
||||||
<button id="load">Load</button>
|
<button id="load">Load</button>
|
||||||
<div id="output"></div>
|
<div id="output"></div>
|
||||||
|
<div id="ui">
|
||||||
|
</div>
|
||||||
<script type="text/javascript" src="lib/crafty.js"></script>
|
<script type="text/javascript" src="lib/crafty.js"></script>
|
||||||
<script type="text/javascript" src="lib/jquery-1.11.1.min.js"></script>
|
<script type="text/javascript" src="lib/jquery-1.11.1.min.js"></script>
|
||||||
<script type="text/javascript" src="src/jsds_crafty.js"></script>
|
<script type="text/javascript" src="src/jsds_crafty.js"></script>
|
||||||
|
|
|
@ -78,8 +78,14 @@
|
||||||
this.enableControl();
|
this.enableControl();
|
||||||
};
|
};
|
||||||
if(e.mouseButton === Crafty.mouseButtons.RIGHT) {
|
if(e.mouseButton === Crafty.mouseButtons.RIGHT) {
|
||||||
|
if ( !cur_sel ) { return; };
|
||||||
|
if ( cur_sel == player[this.id])
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else {
|
||||||
cur_sel.attack(player[this.id]);
|
cur_sel.attack(player[this.id]);
|
||||||
};
|
};
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
|
|
Loading…
Reference in a new issue