class Patterns::Player

Player -> Object

A quick data representation of a player's position

Attributes

position[RW]

The Vector2D of the player's location

Public Class Methods

new(x, y) click to toggle source

Initializes the Player object

  • x - The player's x position

  • y - The player's y position

Examples

=> player = Player.new(3, 5)
# File app/models/singleton/player.rb, line 18
def initialize(x, y)
  @position = Vector2D.new(x, y)
end