Module refers here to the ES Module build of Minze and CDN refers to. Try this intro tutorial if you don't know how to start. Loading Minze via a CDN link from unpkg or jsdelivr. Fork from either of these 2 templates: Official TemplateĪ lighter version that only contains the barebone HTML and JS file.Ĭool! Now you should be all ready to start using Kaboom. Replit has templates that gets rid of manual setup. The various different files are explained. Īnd you have the static file server running on port 8000, just go to and you should be able to load stuff from relative paths like loadSprite( "froggy", "sprites/froggy.png") The files can be browsed and downloaded from a CDN such as unpkg (opens new window) or jsDelivr (opens new window). Let's say you have a folder structure like this. $ static-here if you have static-here installed.$ caddy file-server if you have caddy installed.$ python -m SimpleHTTPServer if you have python2 installed.$ python3 -m rver if you have python3 installed. There're a lot of programs that helps you to do that. To get around that you'll need to use a static file that serves the files through HTTP. Windows Server Popular Sites Using jsDelivr We detected the following sites were using jsDelivr nih.gov. Unpkg Windows Server jsDelivr & Windows Server (12,429) jsDelivr vs. You might have encountered errors when trying to loadSprite() from local file system, that is because browser won't allow loading local files with JavaScript. Unpkg jsDelivr & Unpkg (12,554) jsDelivr vs. Just run $ esbuild game.js -bundle > build.jsĪnd it'll find the Kaboom package and include it in the built build.js, include build.js in your HTML and you're good to go. Once you have esbuild installed, and you have this in a. There's a lot of options like esbuild, webpack, parcel, vite, etc, here I'll give a short example of how to use Kaboom with esbuild. $ npm install kaboomīut you'll need to use a bundler to use Kaboom with NPM. With NPM it's easier have some other packages and do version control, also it's easier to get typescript autocomplete support and stuff, but it requires a bit more setup. The example above is using Kaboom with es6 module, you can also just include it with a tag Using NPM The Kaboom package is deployed to NPM, so it's availbale on various CDN providers, like unpkg, skypack, jsdelivr, etc. This will give you the standard fullscreen Kaboom canvas. The big javascript CDNs are used by huge numbers of people cdnjs brags that its on 12. unpkg and jsdelivr are global CDN and they can be used to deliver any packages hosted in NPM unpkg and jsdelivr both provides CDN for the content hosted in NPM. add a piece of text at position (120, 80) add([ import kaboom lib import kaboom from "" We tried to proceed the same way and we removed sodoSearch from the configuration file (versions/5.7.0/core/shared/config/defaults. Getting the package from a CDN provider is the quickest and easiest way to start using Kaboom. Since Ghost version 5.5.0 UNPKG has been replaced with JSDELIVR.
0 Comments
Leave a Reply. |