Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

A note on warring. Warring players show their (kills,deaths)

  • Loading branch information...
commit c55c77aad9e5b62041a6ba320d228fd8d811292c 1 parent 53f36c4
@billstclair authored
Showing with 12 additions and 1 deletion.
  1. +4 −0 index.html
  2. +8 −1 js/jsClientMaze.js
View
4 index.html
@@ -310,6 +310,10 @@
double tap.<br/>
To change maze (disconnected only), click to toggle walls on
lower view.</p>
+ <p>Peaceful players can see only other peaceful players.<br/>
+ Players at war (after you press the "War" button),<br/>
+ can see only other players at war. Don't you wish<br/>
+ the real world worked that way?</p>
<p>Code is at <a href='https://github.com/billstclair/jsmaze'>github.com/billstclair/jsmaze</a>.<br/>
IRC at <a href="irc://irc.freenode.net/#jsMaze">irc.freenode.net/#jsMaze</a></p>
</center>
View
9 js/jsClientMaze.js
@@ -1037,7 +1037,14 @@ var jsClientMaze = {};
function drawPlayerName(ctx, playerOrName, dy, left, top, width) {
var name = playerOrName;
- if (typeof(name) != 'string') name = playerOrName.name;
+ if (typeof(name) != 'string') {
+ name = playerOrName.name;
+ if (playerOrName.warring) {
+ var score = playerOrName.score;
+ name += ' (' + (score ? score.kills : 0) +
+ ',' + (score ? score.deaths : 0) + ')';
+ }
+ }
ctx.fillStyle = 'purple';
ctx.font = Math.floor(dy) + 'px Arial';
var textWidth = ctx.measureText(name).width;
Please sign in to comment.
Something went wrong with that request. Please try again.