KAPLAY Crew Plugin
KAPLAY Crew is the collection of assets made by KAPLAY. You can easily load them into your game using the crew plugin.
Setup @kaplayjs/crew
First of all you have to install @kaplayjs/crew
package:
npm i @kaplayjs/crew
Now, you need to load your plugin whatever you have kaplay
import { crew } from "@kaplayjs/crew";
import kaplay from "kaplay";
kaplay({ plugins: [crew] });
loadCrew
With loadCrew(kind, asset, name?)
we can load all the KAPLAY Crew available catalog.
kind
is the kind of the asset,sprite
,sound
orfont
asset
is the asset to load, for example, insprite
kind, it would bebean
name
optional, you can load a different name for a sprite
loadCrew("sprite", "bean");
loadCrew("sound", "bean_voice");
loadCrew("font", "happy");
This function is highly typed so you will get a great autocomplete. You can also visit KAPLAY Crew site where you will find the code for loading in all assets.