Adding / mutliplying objects
Monkey Forums/Monkey Programming/Adding / mutliplying objects
| ||
In XNA / C# I am able to add vectors to vectors to create a product vector.Local v1:Vector2 = Vector2.Create(10,10) Local v2:Vector2 = Vector2.Create(5,-5) Local v3:Vector2 = v1 + v2 Print v3.x Print v3.y The above would output 15 5 Is this possible in Monkey? |
| ||
| No operator overloading in Monkey allowed (yet???). You have to make your own:
Class Vector2
Field x#, y#
Method Add(v:Vector2)
x+=v.x; y+=v.y
End
End
v1.Add(v2)
|
| ||
| Ahh ok, yeah that's what I am doing at the moment. Cheers Adam |