Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by Mickety

  1. So I'm making an online game with socket.io and phaser and I run into a little problem: Everything moves faster on PC while android devices lag behind. I use game.physics.arcade.moveToObject to move to a waypoint but the same problem occures with moveToXY and other methods. Here is logic: Two players are on the map in the same X position but different Y positions. Player one on PC clicks on a location to the right a few pixels and starts moving to right on both screens of PC and Android device. Player one arrives to desired location earlier on PC while still movin
  2. Ermm... You can't use Phaser with anything except JavaScript (afaik?) Did you mean like compiler languages like CoffeeScript or am I missing something?
  3. Afaik Phaser doesn't do 3D right now (like at all. Maybe you could emulate DOOM's fake 3D engine but that is as far as one would go). So go for three.js. Might also want to check bablyon.js , I think it is a tiny bit easier to grasp. Also it doesn't matter which service you use to host/construct a website, as long as you can put code on some pages in it's iternal editor or via ftp you're good to go.
  4. You are welcome. Hope it helps.
  5. it sounded like you've messed up the scoping rules of JavaScript (since I don't see the whole code that would be the best assumption) untill you mentioned that disabling "fixedToCamera" fixes the issue. I'm at a loss now.
  6. Could you provide a console error when you try to use setScreenSize() ? From what it seems it looks like setScreenSize() is deprecated (and one should avoid using it directly in the first place). Try using updateLayout() it seems to do the thing you want.
  7. There is no way to absolutely hide ANY javascript code or objects handled by JS in any way. If one desires to find something in your code enough - they will. You'll might want to switch to a compiling language and build executables where code is hidden like C++ or whatever. It may work, reverse engineering to get the initial code is never fast but it's still possible. You could use Phaser for only visual representation of a game or a project and hide the logic on a server with libs like socket.io but for that you'll need to rent a server at least, so there is that. Hope it helps
  8. What exactly do you mean by "Phaser backend"?
  9. This is not strictly a Phaser thing. This gives context to whatever you assign it and depends on where you call it first. Read about it a bit more here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this You could use let for instance, but whatever variable you assign with let for instance in "create" cycle it will only be visible there and not in update or render cycle or wherever else. If you use this just by it self it will represent the object in context of which it has been called. It's hard to explain this in the first place so I'd suggest
  10. Phaser 3 is ready to use AFAIK, but people have complained about lack of examples or docs that even beginners can understand. So if you are good at development in general and can read docs well enough you can go for Phaser 3. Also Phaser CE (2) uses PIXI.js while Phaser 3 uses it's own custom renderer AFAIK
  11. It would be nice to know how you did it if it's not over 9000 lines of code. Anyways it is great that you've figured it out youself - very good for the learning experience.
  12. Might want to check this too. It's a version of PhoneGap but free (?) https://cordova.apache.org/
  13. Yeah I have the same problem. Almost made me want to forget about zooming at all
  14. I think the collision box is a little wider. Try moving right and jumping BEFORE you hit the wall. Once you do, character will hit a ceiling, that is not there. Hope this gives you some insight.
  15. Wouldn't blank_platform.callAll('body.setSize', '', 300, 300, 0, 0); work as well? Anyways It's great that you found your own solution
  16. why not use Phaser.Math.random() ? It can be used as a range between numbers like Phaser.Math.random(-20,250)
  17. Don't "snap" the clock hands to time right away, when you move them. Snap them to realtive measurements when you release the mouse button. That's all I can say at this point, maybe someone more skilled will tell you how to fix this more easily.
  18. Start with a timer function and an array that stores your obstacles in the UPDATE cycle. And with this we've created an obstacle generator. You can also add Phaser.Math.random(0,64) to x and/or y position of an obstacle for randomness Next we need to manage the obstacles I bet phaser group collision can do a better job here though but you'll have to read up on it yourself, because I don't know much about it. Hope it helps.
  19. var game = new Phaser.Game(820, 360, Phaser.AUTO); var mainMenu = function(game) {}; mainMenu.prototype = { preload: function() { //preloading assets game.load.atlas('sprites', 'assets/img/spritesheet.png', 'assets/img/sprites.json'); }, create: function () { // background this.background = this.game.add.tileSprite(0, -30, this.game.width, 390, 'sprites', 'background'); this.background.autoScroll(-100, 0); // ground this.background = this.game.add.tileSprite(0, 310, this.game.width, 60, 'sprites', 'ground'); this.background.autoScroll(-200, 0);
  20. while we on the subject I fixed spacebar just pressed by the code provided. I tested it, it has to work. Here you go. code taken from this thread:
  21. I'd stick to phaser 2 CE for now. Even though quite hypocritically I regret not learning phaser 3 since I've gotten much better at reading docs while learning Phaser 2.
  22. I am glad it helped. I'm also glad the message was sent, because right after I posted than response my internet went down
  23. You don't need anything but "justPressed" So instead of if (game.input.keyboard.justPressed(Phaser.Keyboard.SPACEBAR) && keyDown == false) { keyDown = true; game.state.start('GamePlay'); } if (game.input.keyboard.justReleased(Phaser.Keyboard.SPACEBAR)) { keyDown = false; } Just put this: if (game.input.keyboard.justPressed(Phaser.Keyboard.SPACEBAR)) { game.state.start('GamePlay'); } "justPressed" has an in-built switch for button press, so you don't really need any "keyDown" and stuff.
  24. Well once a computer (or anything for that matter) connects to a WiFi network it gets it's own inner IP address. Usually your router IP is something like "" (at least if you have a wire connecting router to PC directly). Any other device will have an IP like "" or "" My phone for example has a IP address, so if I were to run a web-server on it I could connect to it via that IP address if my PC was connected to the same WiFi router. Basically all you need to do is: -Have two PCs (or similar devices) connected to the same WiFi n
  • Create New...