Class Pill

Pill is a block that pills are made of

Hierarchy

  • Pill

Constructors

  • Creates a new Pill

    Parameters

    • color1: CellColor

      The color of the left cell

    • color2: CellColor

      The color of the right cell

    • pos: Vector

      Start position of the pill

    Returns Pill

Properties

animationFrame: number = 0
cells: any[]
disconnected: boolean = false
rotation: number = 0

Methods

  • Breaks the pill into two separate cells

    Parameters

    • cell: Cell

      The cell that caused the pill to break

    Returns void

  • Moves the pill by a vector. Does not check for collisions!

    Parameters

    • vec: Vector

      The vector to move the pill by

    • Optional isAnimation: boolean

      landed won't be set to false if this is true

    Returns void

  • Rotates the pill by 90 degrees

    Parameters

    • direction: boolean

      The direction to rotate the pill in (true = clockwise, false = counterclockwise)

    Returns void

  • Sets both cells' landed property to true

    Returns void

Generated using TypeDoc