Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/litecanvas/utils
🛠️ Small collection of tools for developing games with litecanvas.
https://github.com/litecanvas/utils
camera litecanvas math utilities vector
Last synced: about 2 months ago
JSON representation
🛠️ Small collection of tools for developing games with litecanvas.
- Host: GitHub
- URL: https://github.com/litecanvas/utils
- Owner: litecanvas
- License: mit
- Created: 2024-07-02T00:58:37.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-10-27T18:59:21.000Z (2 months ago)
- Last Synced: 2024-10-27T23:15:03.892Z (2 months ago)
- Topics: camera, litecanvas, math, utilities, vector
- Language: JavaScript
- Homepage:
- Size: 127 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Litecanvas Utilities
Small collection of tools for developing games with [Litecanvas](https://github.com/litecanvas/game-engine).
## Install
### NPM package
```
npm i @litecanvas/utils
``````js
// import everything
import * as utils from "@litecanvas/utils"const pos = utils.vec(0, 0)
``````js
// or import just what you want
import { vec } from "@litecanvas/utils"const pos = vec(0, 0)
```### CDN
Download from https://unpkg.com/browse/@litecanvas/utils/dist/ and load in a `` tag in your HTML.
```js
// now the "utils" namespace is created
const pos = utils.vec(0, 0)
``````js
// also, you can call this once to
// expose the components globally
utils.global()// now the namescape is not required
const pos = vec(0, 0)
```## Components
- **Camera**: Move-, zoom- and rotatable camera with shake. [Usage & Docs](https://github.com/litecanvas/utils/tree/main/src/camera)
- **Vector**: Modular 2D vector. [Usage & Docs](https://github.com/litecanvas/utils/tree/main/src/vector)
- **Actor**: class to represent game entities. [Usage & Docs](https://github.com/litecanvas/utils/tree/main/src/actor)
- **Grid**: class to handle retangular grid areas. [Usage & Docs](https://github.com/litecanvas/utils/tree/main/src/grid)
- **Collision** utilities. [Usage & Docs](https://github.com/litecanvas/utils/tree/main/src/collision)
- **Tween** to create animations. [Usage & Docs](https://github.com/litecanvas/utils/tree/main/src/tween)
- And some [math utilities](https://github.com/litecanvas/utils/tree/main/src/math)...