0.1.0 • Published 10 months ago

@headless-game-engine/physics-2d v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Headless Game Engine - Physics 2D

A minimalistic, framework-agnostic JavaScript game engine.

This is the Physics 2D package for the Headless Game Engine.

Contains

  • Collider2D
  • BoxCollider2D
  • Rigidbody2D
  • PhysicsSystem2D

BoxCollider2D is an AABB collider that extends from abstract class Collider2D.

Rigidbody2D is capable of adding force to change its velocity, which changes its position.

PhysicsSystem2D does 3 things

  1. Movement Integration
  • Moves the rigidbodies according to their current velocity.
  1. Collision Detection
  • Detects collisions between colliders
  1. Collision Resolution
  • Resolve the collisions between rigidbodies and static colliders by displacing the rigidbody and changing its velocity.