ourcade / phaser3-vite-template Goto Github PK
View Code? Open in Web Editor NEWMake Phaser 3 games with modern frontend tooling.
Home Page: https://youtu.be/isSXKBcuWxw
License: MIT License
Make Phaser 3 games with modern frontend tooling.
Home Page: https://youtu.be/isSXKBcuWxw
License: MIT License
Hi , I'm totally new in Phaser , just downloaded the repository and yarn on it:
the project shows this error in the console:
Uncaught Error: createEmitter removed. See ParticleEmitter docs for info
at ParticleEmitter2.createEmitter (phaser.js:66171:15)
at HelloWorldScene.create (HelloWorldScene.js:21:29)
at SceneManager2.create (phaser.js:193257:26)
at SceneManager2.loadComplete (phaser.js:193164:14)
at LoaderPlugin2.emit (phaser.js:200:35)
at LoaderPlugin2.loadComplete (phaser.js:118144:14)
at LoaderPlugin2.fileProcessComplete (phaser.js:118110:18)
at ImageFile2.onProcessComplete (phaser.js:116909:21)
at data.onload (phaser.js:123186:19)
Had to comment all the reference to the Particle emitter in MainWorldScene.js:
import Phaser from 'phaser'
export default class HelloWorldScene extends Phaser.Scene {
constructor() {
super('hello-world')
}
preload() {
this.load.setBaseURL('https://labs.phaser.io')
this.load.image('sky', 'assets/skies/space3.png')
this.load.image('logo', 'assets/sprites/phaser3-logo.png')
this.load.image('red', 'assets/particles/red.png')
}
create() {
this.add.image(400, 300, 'sky')
// const particles = this.add.particles('red')
// const emitter = particles.createEmitter({
// speed: 100,
// scale: { start: 1, end: 0 },
// blendMode: 'ADD',
// })
const logo = this.physics.add.image(400, 100, 'logo')
logo.setVelocity(100, 200)
logo.setBounce(1, 1)
logo.setCollideWorldBounds(true)
// emitter.startFollow(logo)
}
}
This makes it much easier to create new repositories from this project directly on GitHub and various GitHub interfaces.
the current build process sets the location of main.js to "/main.js"
, i recommend adding the following to the config in vite.config.js: base: "./"
. that way the path is set relative to the location of index.html, and you can upload it to a subdirectory on your web server
in your phaser & parcel template, it was a great convenience that the game would reload when assets changed. this doesn't happen in the phaser & vite template, since vite does not by default provide that function. i have however been missing the feature, and have found this vite plugin, which has worked for me: https://github.com/ElMassimo/vite-plugin-full-reload
maybe you could add it to the template?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.