Jump to content

mike perry

  • Content Count

  • Joined

  • Last visited

  1. I solved it - this example is very helpful http://jsfiddle.net/4yh8ee1f/46/
  2. How to detect collision between sprite and shape created by bitmap? In example I have sprite: this.player = this.add.sprite(0, 0, 'player') this.player.anchor.setTo(0.5) this.player.scale.setTo(0.1) And bitmap: this.bmd = this.game.add.bitmapData(2000, 2000) this.bmd.addToWorld() And then I draw shape using bmd object: this.bmd.rect(px, py + 15, 5, 500, 'rgba(255, 255, 255, 1)') Then I call this method: this.bmd.update() It looks more or less like in image. Yellow ball is my sprite. White curved line is my shape created from bitmapdata. And I want detect
  3. I solved this. You can't call the update method because then you override it from the Phaser.Sprite class. Instead, just change the name to your own, e.g. move(cursors)
  4. How to pass the cursor object to a method that belongs to a class that inherits the Phaser.Sprite class? I have a class that inherits from Phaser.State in which I create a cursor object and pass it to the update method from another class. class Play extends Phaser.State { create() { this.physics.startSystem(Phaser.Physics.ARCADE) ... this.player = new Player({ game: this.game, x: 32, y: this.world.height - 150, asset: 'dude' }) this.game.add.existing(this.player) } update() { const cursors = this.input.keyboard.createCursorKeys(
  5. Thanks for reply. I solved this problem by indicate to the folder in which the scripts are located . In my case it was a folder called 'dev'. Adding this line solved the problem: app.use('/dev', express.static('dev')) Additional question Is there any way to run webpack only for build scripts not for running webpack server? The node server needs scripts to open the HTML file correctly. Scripts are built by running webpack in development mode. Is it good practise if I start webpack and node server with one command? Something like below (using "start"). "start": "co
  6. How do you configure the server for this template ? => https://github.com/nkholski/phaser3-es6-webpack I'm trying to do it by following this tutorial => https://gamedevacademy.org/create-a-basic-multiplayer-game-in-phaser-3-with-socket-io-part-1/?a=13 I added two dependencies: nodemon and express. I created the server.js file with the server configuration. const express = require('express') const app = express() const server = require('http').Server(app) const path = require('path') app.get('/', function(req, res) { res.sendFile(path.resolve('index.html')) }) server.listen
  • Create New...