Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Truck

Hierarchy

Index

Constructors

constructor

  • new Truck(root: any): Truck

Methods

advance

  • advance(amount?: any): any
  • Advances the truck by the given amount. Amount is world space pixels here

    Parameters

    • Default value amount: any = null

    Returns any

    if the truck moved, false if it arrived

belongsToFaction

  • belongsToFaction(faction: any): boolean
  • Override, should return true if the object does belong to the given faction

    Parameters

    • faction: any

    Returns boolean

deliver

  • deliver(): boolean
  • Returns boolean

deserialize

  • deserialize(data: any): any

doDraw

  • doDraw(parameters: any): void
  • Draws the object

    Parameters

    • parameters: any

    Returns void

draw

  • draw(parameters: any): void
  • Draws the truck

    Parameters

    • parameters: any

    Returns void

finalizeBeforeSave

  • finalizeBeforeSave(): void
  • Override, do anything before saving. Return DESTROY_OBJECT to destroy the object

    Returns void

getPosition

  • Returns the world space position of this projectile

    Returns Vector

getWorldSpaceTravelAmountPerLogicFrame

  • getWorldSpaceTravelAmountPerLogicFrame(): number
  • Computes the effective speed of the truck in world pixels / logic frame

    Returns number

isArrived

  • isArrived(): boolean
  • Returns if the truck has arrived

    Returns boolean

isDeliveryTimeReached

  • isDeliveryTimeReached(): boolean

isImportantForGame

  • isImportantForGame(): boolean
  • Override, should return false if this object is no longer important for the game, e.g. because it now only displays cosmetic effects or so

    Returns boolean

onDestroyed

  • onDestroyed(): void

onSpawned

  • onSpawned(params: any): void
  • Parameters

    • params: any

    Returns void

serialize

  • serialize(): object

tryMerge

  • tryMerge(otherTruck: any): boolean
  • Tries to merge with the other truck

    Parameters

    • otherTruck: any

    Returns boolean

update

  • update(): any

Static getCachedSchema

  • getCachedSchema(): any

Static getId

  • getId(): string

Static getSchema

  • getSchema(): object

Static verify

  • verify(data: any): string