Jump to content


  • Content Count

  • Joined

  • Last visited

1 Follower

About MeMyMo

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. So it was actually working, it was just that I had a black background and the camera followed my character. Doh.
  2. I haven't been able to figure this out. I have a "Player" class that extends Sprite: export default class Player extends Phaser.GameObjects.Sprite{ constructor(scene, x, y, config) { super(scene, x, y, config.key); this.scene = scene; this.lastAnim = null; this.vel = 200; this.scene.physics.world.enable(this); this.scene.add.existing(this); const { LEFT, RIGHT, UP, DOWN } = Phaser.Input.Keyboard.KeyCodes; this.keys = this.scene.input.keyboard.addKeys({ left: LEFT, right: RIGHT, up: UP, down: DOWN, }); } preUpdate (time,
  3. It seems to work for me in VS Code? https://i.imgur.com/8mGagTo.png
  4. I don't know if this helps, but someone ported Box2D to JS recently: https://github.com/shakiba/planck.js Maybe the performance is better?
  5. Basically what the title says. I'm having a hard time thinking how you can build a simple UI with some dynamic text/buttons/scrollable fields, etc. A group with sprites? Outside of Phaser with HTML/CSS?
  6. I'm an idiot, the walkable tile was 3, not 2.
  7. Hey, I'm messing around with pathfinding. Modified the Easystar Phaser plugin for ES6, but it seems to always return an empty path: https://max-arias.github.io/miner-idle-1click/ (source is 0,0) Calculation is here: https://github.com/max-arias/miner-idle-1click/blob/master/src/entities/Map.js ... let walkableTiles = [2, 150, 152, 166, 35, 68, 18] this.pathfinder = this.game.plugins.add(PathFinderPlugin); this.pathfinder.setGrid(this.layers[1].data, walkableTiles); } update () {} findPathTo(fromX, fromY, toX, toY) { this.pathfinder.setCallbackFunction
  8. You would need to use something like this: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia
  9. You could do something like: var tile; var map = []; var tileWidth = 38; for (var xx = 0; xx < 10; xx++) { map[xx] = []; for (var yy = 0; yy < 10; yy++) { // Create a tile using the new game.add.isoSprite factory method at the specified position. // The last parameter is the group you want to add it to (just like game.add.sprite) tile = game.add.isoSprite(xx tileWidth, yy * tileWidth, 0, 'tile', 0, tileGroup); tile.anchor.set(0.5, 0); map[xx][yy] = 1; } } console.log(map) But you should probably look into tilemaps and Tiled, it'll help a lot. Also,
  10. I've been looking at how BrowserQuest does it and I'm getting a better idea. I'll read up on your link Skeptron, too. For the moment I'll go with something a bit more amateur-ish, I don't think it's all that important that it's 'hackable' as much as releasing something is. Appreciate the input guys, thanks.
  11. Maybe something simpler, like: if (direction != 0) { //Move this.player.body.velocity.y = direction * this.PLAYER_SPEED; } if (firePress) { //Fire this.createPlayerBullet(); }
  12. Might have better luck here: http://www.html5gamedevs.com/forum/22-jobs-hiring-and-freelance/
  13. Ah, sorry about that. Googled a bit and it looks like it's not as straightforward. Maybe: http://www.html5gamedevs.com/topic/4760-best-way-to-recreate-old-physicsoverlap-using-p2/ ?
  14. Hey, So I'm messing around with Phaser and Socket.IO, I got a simple "game" working where multiple players can connect and you can see each other/move. The thing is that movement/collisions (for the current player) is client side, relying on arcade physics and x/y velocities. I'm a webdev, so I know it's not smart to rely on the client, but I'm having some difficulty understanding how I would do collisions/movement on the server side. Movement might be easier, I could probably have an update loop on the server and just send over the player's moving direction and then calcul
  15. I would start with free resoures, Phaser has some: https://phaser.io/tutorials/making-your-first-phaser-game
  • Create New...