API Docs for: 0.1.1
Show:

flatworld.extensions.hexagons.ObjectHexaUnit Class

Map unit like infantry or worker, usually something with actions or movable. Usually these are extended, depending on the map type. For example you might want to add some click area for these (e.g. hexagon)

Constructor

flatworld.extensions.hexagons.ObjectHexaUnit

(
  • coords
  • data
  • options
)

Parameters:

  • coords Object

    This units coordinates, relative to it's parent container

    • x Integer

      X coordinate

    • y Integer

      Y coordinate

  • data Object

    This units custom data

  • options Object

    options.radius REQUIRED

    • radius Object

      REQUIRED. This is the radius of the game maps hexagon

Item Index

Methods

Methods

calculateHexa

(
  • radius
)
private static

Parameters:

  • radius Number

    Hexagon radius

setAndGetShape

(
  • radius
)
private static

Parameters:

  • radius Number

    Hexagon radius