Tron game keyevent issue
<p>I want to make a 'Tron-game like' little game, heres the code, i already made: <a href="http://jsfiddle.net/Jim_Y/KQW5w/2/" rel="nofollow">http://jsfiddle.net/Jim_Y/KQW5w/2/</a>
code snippet:</p>

<pre><code>$(document).keydown(function (e) {
        if (e.keyCode == 37) {
            // leftArrowPressed
            palette.leftArrowPressed();
        } else if (e.keyCode == 38) {
            //  topArrowPressed
            palette.topArrowPressed();
        } else if (e.keyCode == 39) {
            // rightArrowPressed
            palette.rightArrowPressed();
        } else if (e.keyCode == 40) {
            // bottomArrowPressed
            palette.bottomArrowPressed();
        }

        return false;
    });

Palette.prototype.leftArrowPressed = function () {
    this.X = this.X - this.game.speed;
    this.context.lineTo(this.X, this.Y);
    this.context.stroke();
}
</code></pre>

<p>The problem is, when i press one of the arrow keys and draw a line, then press a different arrow key, there is a little break on the drawing, so the line-drawing is not continuous :/
Any advice?</p>
