Implemented variables properly.

This commit is contained in:
Devine Lu Linvega
2016-12-20 11:16:47 -07:00
parent 6c3ed550d3
commit 27117db46c
10 changed files with 90 additions and 53 deletions

View File

@@ -8,6 +8,11 @@ function Position(position_str = "0,0",y = null)
this.x = y ? position_str : parseFloat(this.position_str.split(",")[0]);
this.y = y ? y : parseFloat(this.position_str.split(",")[1]);
this.add = function(position)
{
return new Position(this.x + position.x, this.y + position.y);
}
this.is_equal = function(target)
{
if(target.x == this.x && target.y == this.y){ return true; }

View File

@@ -4,7 +4,10 @@ function Variable(key,value)
this.candidates = [];
this.key = key;
this.value = value;
if(value == "true"){ this.value = true; }
else if(value == "false"){ this.value = false; }
else{ this.value = value; }
this.render = function()
{