diff --git a/scripts/ronin.brush.js b/scripts/ronin.brush.js index 4eed28c..0a2523b 100644 --- a/scripts/ronin.brush.js +++ b/scripts/ronin.brush.js @@ -19,11 +19,13 @@ function Brush() if(cmd.color()){ this.color = cmd.color(); } + if(cmd.value()){ + this.size = cmd.value(); + } } this.passive = function(cmd) { - console.log("Nothing to do."); } // Commander diff --git a/scripts/ronin.brush.pointer.js b/scripts/ronin.brush.pointer.js index 9b4802a..3509cf3 100644 --- a/scripts/ronin.brush.pointer.js +++ b/scripts/ronin.brush.pointer.js @@ -1,7 +1,6 @@ function Pointer(offset = new Position(), color = new Color('000000')) { this.offset = offset; - this.color = color; this.mirror = null; this.position_prev = null; @@ -23,9 +22,9 @@ function Pointer(offset = new Position(), color = new Color('000000')) this.thickness = function() { - var v = 100 - ((this.position().distance_to(this.position_prev))); - var t = v/40; - return t < 1 ? 1 : t; + var ratio = 10/this.position().distance_to(this.position_prev); + ratio = ratio > 1 ? 1 : ratio; + return ronin.brush.size * ratio; } this.position = function() diff --git a/scripts/unit.command.js b/scripts/unit.command.js index 4352dd4..31a7e80 100644 --- a/scripts/unit.command.js +++ b/scripts/unit.command.js @@ -33,4 +33,13 @@ function Command(cmd_array) } return null; } + + this.value = function() + { + for (i = 0; i < this.cmd_array.length; i++) { + var test = /[^$\-\d]/.test(this.cmd_array[i]); + if(!test){ return parseFloat(this.cmd_array[i]); } + } + return null; + } } \ No newline at end of file