On this page

britzl/platypus/platypus.platypus

Defold platformer engine

  • GitHub: britzl/platypus — pinned to 2fe3aed
    1. Pick a release from britzl/platypus releases and add its Source code (zip) URL (or a packaged .zip asset, if the library ships one) to game.project under [project] dependencies, then Fetch Libraries in the Defold editor.
    2. Run bunx @defold-typescript/cli resolve to materialize its types.
    3. Import it under a namespace alias of your choice:
      import * as platypus from "platypus.platypus"

Functions

create(config: PlatypusConfig): PlatypusInstance

Parameters

  • config: PlatypusConfig

Returns

  • PlatypusInstance

Variables

FALLING: Hash

GROUND_CONTACT: Hash

WALL_CONTACT: Hash

JUMP: Hash

WALL_JUMP: Hash

DOUBLE_JUMP: Hash

WALL_SLIDE: Hash

DIR_UP: Direction

DIR_LEFT: Direction

DIR_RIGHT: Direction

DIR_DOWN: Direction

DIR_ALL: Direction

Types

PlatypusConfig.collisions: { groups: LuaMap<Hash, Direction>; left: number; right: number; top: number; bottom: number; offset?: Vector3; }

PlatypusConfig.debug: boolean

PlatypusConfig.reparent: boolean

PlatypusConfig.gravity: number

PlatypusConfig.max_velocity: number

PlatypusConfig.wall_jump_power_ratio_x: number

PlatypusConfig.wall_jump_power_ratio_y: number

PlatypusConfig.allow_double_jump: boolean

PlatypusConfig.allow_wall_jump: boolean

PlatypusConfig.const_wall_jump: boolean

PlatypusConfig.allow_wall_slide: boolean

PlatypusConfig.wall_slide_velocity: number

PlatypusInstance.update(dt: number)

Parameters

  • dt: number

PlatypusInstance.on_message(message_id: Hash, message: AnyNotNil)

Parameters

  • message_id: Hash
  • message: AnyNotNil

PlatypusInstance.left(velocity: number)

Parameters

  • velocity: number

PlatypusInstance.right(velocity: number)

Parameters

  • velocity: number

PlatypusInstance.up(velocity: number)

Parameters

  • velocity: number

PlatypusInstance.down(velocity: number)

Parameters

  • velocity: number

PlatypusInstance.move(velocity: Vector3)

Parameters

  • velocity: Vector3

PlatypusInstance.jump(power: number)

Parameters

  • power: number

PlatypusInstance.force_jump(power: number)

Parameters

  • power: number

PlatypusInstance.abort_jump(reduction: number)

Parameters

  • reduction: number

PlatypusInstance.abort_wall_slide()

PlatypusInstance.has_ground_contact(): boolean

Returns

  • boolean

PlatypusInstance.has_wall_contact(): boolean

Returns

  • boolean

PlatypusInstance.is_falling(): boolean

Returns

  • boolean

PlatypusInstance.is_jumping(): boolean

Returns

  • boolean

PlatypusInstance.is_wall_jumping(): boolean

Returns

  • boolean

PlatypusInstance.is_wall_sliding(): boolean

Returns

  • boolean

PlatypusInstance.toggle_debug()

PlatypusInstance.set_collisions(collisions: { top: number; left: number; right: number; bottom: number; })

Parameters

  • collisions: { top: number; left: number; right: number; bottom: number; }
    • top: number
    • left: number
    • right: number
    • bottom: number

PlatypusInstance.velocity: Vector3