Small collection of tools for developing games with Litecanvas.
Tip
All modules of this package are automatically loaded on Litecanvas playground.
npm i @litecanvas/utils
// import everythingimport*asutilsfrom"@litecanvas/utils"constpos=utils.vec(0,0)// or import just what you wantimport{vec}from"@litecanvas/utils"constpos=vec(0,0)Download or load from a CDN:
// now the "utils" namespace is createdconstpos=utils.vec(0,0)// also, you can call this once to// expose the components globallyutils.global()// now the namescape is not requiredconstpos=vec(0,0)- Camera: Move-, zoom- and rotatable camera with shake. Usage & Docs
- Vector: Modular 2D vector. Usage & Docs
- Actor: class to represent game entities. Usage & Docs
- Grid: class to handle retangular grid areas. Usage & Docs
- Collision utilities. Usage & Docs
- Tween to create animations. Usage & Docs
- Image to manipulate images. Usage & Docs
- Collection to manipulate lists (arrays). Usage & Docs
- And some math utilities...