Skip to content

Commit

Permalink
fingthing with adam
Browse files Browse the repository at this point in the history
  • Loading branch information
pbwilmot committed Mar 7, 2012
1 parent cc86ad4 commit 5db6e88
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/test.coffee
Expand Up @@ -8,7 +8,7 @@ z=new Vector2(v)
console.log(z)


###test add
#test add
v.add(1)
console.log v.getX(),v.getY()
v.add(v)
Expand All @@ -21,4 +21,4 @@ console.log v.getX(),v.getY()

n = new WorldObject()
console.log(n)
###

6 changes: 3 additions & 3 deletions src/vector.coffee
@@ -1,7 +1,7 @@
class Vector2
constructor:(@x=0,@y=0) ->
if @x instanceof Vector2
vec=@x
if x instanceof Vector2
vec=x
@x=vec.x
@y=vec.y

Expand Down Expand Up @@ -88,7 +88,7 @@ class Vector3
return this.z
# add ascalar
add: (vec) ->
if typeof vec is "Vector2"
if vec instanceof Vector3
this.x += vec.getX()
this.y += vec.getY()
else
Expand Down

0 comments on commit 5db6e88

Please sign in to comment.