Board Game Experiment, with JS Prototypes and Canvas

A Setting Form

Many options can be changed.

This little form allows you, for example, to change the player’s name.

  <input class="input-medium" type="text" id="name" name="username" placeholder="Name">

Let’s create two methods for the User object to set it right.

User.prototype.setName = function (name) {
  'use strict';
  if (name === undefined) { name = jQuery('#name').val(); }
  if (name === '') { name = 'You'; } = name;

User.prototype.displayName = function () {
  'use strict';
  jQuery('.name', this.caption).text(;