Quivy
A micro-framework to quicky start your games and animations. Quivy provides some useful features like:
- Create or select (using CSS selectors) a
<canvas>
element; - Load images and other resources;
- Animate using a simple API.
Installation
Of course You're using Yarn. Right!?
yarn add quivy
You can also install using NPM.
npm i quivy
Usage
Example
; const element context = canvas;const animation = const person = x: 0 y: 0; loader ; { context; ... if isGameOver animation;}
Quivy Modules
Loader
; loader; loader // image is default value ; loader; loader // You could use events instead of promise methods ; loaderonLoad = setup;loader console; // There's also a loading eventloader { let percent = ~~filesLoaded / totalFilesToLoad * 100; resourcename; // Resource name resourcesource; // URL resourceitem; // Image/Audio/Video instance.};
Animate
; const animation = // Make a sprite move and stop after 3sanimationstart;;
Canvas
; const context: ctx1 = canvas; const element: el2 context: ctx2 = canvas;