class Patterns::Vector2D
A quick data representation of a location in 2D space
Attributes
x[RW]
The x and y values of the vector
y[RW]
The x and y values of the vector
Public Class Methods
new(x, y)
click to toggle source
Initializes the Vector2D object
-
x
- The x position of the object -
y
- The y position of the object
Examples
=> position = Vector2D.new(0, 5)
# File app/models/singleton/player.rb, line 39 def initialize(x, y) @x = x @y = y end