svelte-phaser
v0.1.0-beta.2
Published
Create Phaser 3 games with Svelte 3
Downloads
30
Readme
Documentation
Check out the documentation
Getting Started
Creating a new project
npx degit mattjennings/svelte-phaser/templates/svite my-first-game
cd my-first-game
npm install
npm run dev
# or if you prefer typescript:
npx degit mattjennings/svelte-phaser/templates/svite-typescript my-first-game
cd my-first-game
npm install
npm run dev
There are some other templates available as well
If a blank project is too boring, feel free to look through the examples.
Adding to an existing project
If you have an existing svelte project you can just install svelte-phaser
:
npm install phaser svelte-phaser
and then import it:
<script>
import { Game, Scene, Text } from 'svelte-phaser'
</script>
<Game width={400} height={400}>
<Scene key="main">
<Text x={140} y={180} text="hello world" />
</Scene>
</Game>