• Content Count

  • Joined

  • Last visited

  • Days Won

  1. This is already a function , how are you intending to call it?
  2. Hi @Adele welcome to html5gamedevs 😄. Without seeing the context of your code I cannot help that much. But, I will give it a try. This is how I would implement a double jump on my game. // create a variable canDoubleJump function update() { if (this.keys.left.isDown) { this.body.setAccelerationX(-1000);'left',true); } else if (this.keys.right.isDown) { player.body.setAccelerationX(1000);'right',true); } else {'idle',true); player.body.setAccelerationX(0); } const didPressJump = Phaser.Input.Keyboard.JustDown(this.keys.up); // player can only double jump if the player just jumped if (didPressJump) { if (player.body.onFloor()) { // player can only double jump if it is on the floor this.canDoubleJump = true; player.body.setVelocityY(-100); } else if (this.canDoubleJump) { // player can only jump 2x (double jump) this.canDoubleJump = false; player.body.setVelocityY(-100); } } }
  3. This is a Phaser 3 starter with , Rollup for bundling and nollup as development server. Hi I am a frontend developer by profession and just thought of digging into HTML5 Game Development amidst this pandemic (Stay at home and take care of your health). This starter is based on the template created by Richard Davey with a number of improvements: Only 1 rollup config for both development and production No JavaScript files are written to disk during development which makes it very fast thanks to nollup Has hot reload feature, code recompiles balzingly fast and browser refreshes as you change your source code. Static files are separated on public folder, sources (TypeScript) on src folder Can easily be deployed to production using a free services like Netlify. With the following configuration Build Command: yarn build Publish Directory: dist This is a sample that is deployed to Netlify,
  4. @Nassim's Lab Do you see any error on the browser console?