Implemented offset

This commit is contained in:
Devine Lu Linvega
2017-11-06 13:18:57 +13:00
parent d4be61a250
commit e09894af69
4 changed files with 43 additions and 17 deletions

View File

@@ -13,6 +13,11 @@ function Pos(x,y)
return new Pos(this.x - pos2.x,this.y - pos2.y)
}
this.add = function(pos2)
{
return new Pos(this.x + pos2.x,this.y + pos2.y)
}
this.is_equal = function(pos2)
{
return pos2.x == this.x && pos2.y == this.y;