module RTanque

RTanque

#Interesting classes for the spelunker:

Constants

Arena
Configuration

@!visibility private

Point

A `Point` represents an [x, y] coordinate pair in the {RTanque::Arena}

##Usage

@arena = RTanque::Arena.new(100, 100)
# => #<struct RTanque::Arena width=100, height=100>

@point_one = RTanque::Point.new(0, 1, @arena)
# => #<struct RTanque::Point x=0, y=1, arena=#<struct RTanque::Arena width=100, height=100>>

@point_one.on_top_wall?
# => false

@point_one.on_bottom_wall?
# => false

@point_one.on_right_wall?
# => false

@point_one.on_left_wall?
# => true

@point_one.on_wall?
# => true

@point_two = RTanque::Point.new(100, 1, @arena)
# => #<struct RTanque::Point x=100, y=1, arena=#<struct RTanque::Arena width=100, height=100>>

@point_two.within_radius?(@point_one, 10)
# => false

@point_two.within_radius?(@point_one, 100)
# => true

@point_two.distance(@point_one)
# => 100.0

@attr_reader [Numeric] x horizontal position (left edge is 0) @attr_reader [Numeric] y vertical position (bottom edge is 0) @attr_reader [RTanque::Arena] arena

@!method distance(other_point) distance to other point

@param [RTanque::Point]
@return [Float]

@!method heading(other_point) heading to other point

@param [RTanque::Point]
@return [RTanque::Heading]

@!method on_top_wall?

@return [Boolean]

@!method on_bottom_wall?

@return [Boolean]

@!method on_right_wall?

@return [Boolean]

@!method on_left_wall?

@return [Boolean]

@!method on_wall?

True if on any wall
@return [Boolean]
VERSION