I am no longer maintaining this project. The documentation will stay up as the content here may still be useful to some, but I have no plans on continuing this library.
Check out the documentation
The easiest way to get started is to create a new project using the blank template:
npx degit mattjennings/svelte-phaser/templates/blank my-first-game
cd my-first-game
npm install
npm run dev
If a blank project is too boring, feel free to look through the examples.
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>