Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Collision

Built-in concrete 2D Collision System, implementing simple AABB collision for Entities in 2D Games

Tracks Entity-to-Entity collisions for properly invoking an Entity's onCollisionStart, onCollisionContinue and onCollisionEnd methods

To be eligible for collision, an Entity must have both a Transform Component and a BoxCollider Component

Hierarchy

Index

Constructors

Properties

Methods

Constructors

  • Constructor. Provide the name 'Collision' to the parent class

    Returns Collision

Properties

name: string

Methods

  • tick(game: Game): void
  • Concrete update method, implementing per-frame collision functionality for eligible Entities

    Check for and track collision between all eligible Entities and call their appropriate collision handling methods

    Parameters

    • game: Game

      the 2D Game the System is operating within

    Returns void