Answers for "gms2 vector2d"

1

gms2 vector2d

// In your script
Vector2 = function(_x, _y) constructor
{
   x = _x;
   y = _y;

   static Add = function( _other )
   {
      x += _other.x;
      y += _other.y;
   }
}

// Where you want to create a Vector2

vector = new Vector2(x,y);
Posted by: Guest on May-09-2021

Browse Popular Code Answers by Language