• Content Count

  • Joined

  • Last visited

About Arcanorum

  • Rank
    Advanced Member

Contact Methods

  • Website URL
  • Twitter

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

2167 profile views
  1. var _this; GameServer.prototype = { constructor : function(){ _this = this; }, onConnection : function(socket){ socket.on('new_player', _this.onNewPlayer(data)); } } I know it seems like a hack, but it is the cleanest solution that I use and lets me get stuff done easily.
  2. What will happen to the forums (and discord/slack) when Phaser 3 gets closer to release? I'm already seeing discussions pop up about Phaser 3 here and there. Separate subforums/channels for v2.x and v3? What is it that you aren't a fan of with the v2 docs? I think they are great. What plugins are planned for after release?
  3. You need to study the examples more closely. The order of how you assign things to the prototype matters. This is what your objects should look like: Item = function (game, x, y, sprite_name) {, game, x, y, sprite_name); game.physics.enable(this, Phaser.Physics.ARCADE); // Bunch of properties }; /** * Assign the prototype of this object to the same prototype of Phaser.Sprite. * Do this BEFORE adding or overriding any properties on the prototype object * for this object, otherwise they will be overwritten. * * If you do Item.prototype = ... at the end, then the prototype property of * Item will reference a completely different object than the one that you * added .update to. */ Item.prototype = Object.create(Phaser.Sprite.prototype); /** * It doesn't really matter where you assign the constructor, as long as it is * after the declaration of the Item function. */ Item.prototype.constructor = Item; /** * Now that the prototype of Item is using the prototype of Phaser.Sprite, we * can override any functions that Phaser.Sprite has, such as .update, .render, etc. */ Item.prototype.update = function () { // Bunch of things };
  4. You will want to use some build tools that handle things like minifying code for smaller files, and merging files for fewer file requests from the server, to improve load speed. Use a texture atlas if you aren't already, and check out this tutorial I've found that WEBGL_MULTI works a lot better on desktop than mobile, so if you are having FPS trouble, this should work well for you.
  5. Phaser Editor sounds like what you are looking for.
  6. @Ulbast You could use as an alternative to checkWorldBounds.
  7. How did this end up on the game showcase bar?
  8. Rendering is usually the big killer when it comes to performance. This should show you some ways to improve it.
  9. Also, from your code, you seem to think things are a display object when they aren't. Your variable/property names are misleading. When you do if (blue_keyMap.atk.isDown) { this.blueSpriteDo.atk(this.redSpriteDo); //the parameter for the atk function //passes the opposite player, that becomes the opponent } Passing in this.redSpriteDo is not passing in a display object. It is passing in the object returned by the constructor function SpriteDoObj. Calling SpriteDoObj doesn't create a display object for you. You already have your display object when you call var red_player = this.players.create( ... ); That is the display object that you should be using, and the display object that the overlap function is expecting. Seeing as you store a reference to the red_player object inside of function SpriteDoObj(player){ // global function this.player = player; ... } you should pass in that .player property as the argument for the atk function, like so this.blueSpriteDo.atk(this.redSpriteDo.player); Your problem seems to be caused by kind of messy code. I would recommend adding the functions you want the players to have (such as atk) onto the player objects themselves. I doubt you need this extra SpriteDoObj wrapper around the actual display objects.
  10. If this code is arranged like this in the same scope, then that might be the problem. this.blueSpriteDo = new SpriteDoObj(blue_player); this.redSpriteDo = new SpriteDoObj(red_player); //.. also the players are made like this: this.players =; var red_player = this.players.create(window.innerWidth, - 490, 'red_spritesheet'); var blue_player = this.players.create(0, - 490, 'blue_spritesheet'); It looks like you are trying to pass blue_player as an argument to SpriteDoObj before it is defined.
  11. Same. It seems like if WebGL (without MTB) runs poorly on whatever device, then that is likely due to the graphics hardware of that device not being good enough, though this still seems weird as it isn't like we are doing anything crazy like 3D with it. I do get much better performance on desktop using MTB compared to without it, but on desktop what does it even matter, since it can probably handle anything you throw at it anyway. If canvas is more CPU dependent, then I think it would make sense for mobiles to perform better. I just force canvas for everything now, as it much more consistent and reliable. =/
  12. Will this actually be running in the browser on mobiles, or will you be packaging this up as a native app?
  13. I keep randomly dieing in the air when I jump on the second level.
  14. 10 years of programming experience, yet you still don't comment your code?