Popular Content

Showing content with the highest reputation on 11/18/2014 in all areas

  1. 1 point

    Phonegap performance - let me say wow

    I tried to apply this plugin on my existing project and I can confirm that FPS are always at 60 and there's a lesser CPU usage. This is only a workaround at the moment, so I can't reccomend to use it but could be a huge start point for high performance iOS games. iOS8 is installed on 56% of devices at the moment (https://developer.apple.com/support/appstore/) in my humble opinion, due to a jailbreak not available. But now, a JB was released so I think that this 56% will increase early.
  2. 1 point
    Hi fellas! I wrote a quick tutorial introducing the basics of ECS (entity component system) focusing on game design and javascript, it is something that I wish I had understood way (way) earlier and I thought it might be helpful for others. Let me know what you guys think!
  3. 1 point
    Any code you want executed at the creation of the object is done in the constructor: // This is the 'constructor' of the MonsterBunny object - anything in this function is// executed when the object is created.MonsterBunny = function (game, x, y, rotateSpeed) { Phaser.Sprite.call(this, game, x, y, 'bunny'); this.rotateSpeed = rotateSpeed; // ... any other code you want...};
  4. 1 point
    You could make your ObjClass extend Sprite and then override the default kill to include the destruction of the class object. Your real problem is that you probably want to destroy references to the ObjClass object and those are in a different scope entirely. I try to avoid these situations, but when they happen I use a kill flag in the ObjClass, which tells it's owner to kill it. So if you have something like a tank which has a child turret, and for some reason the turret can get destroyed without telling the tank to blow it up... you can add a kill flag to the turret, and next time the tank tries to do anything with the turret you first check the kill flag. If it's true, you know the turret is destroyed (the graphic has been removed already) so you can then call the turret.destroy() using the tank's own reference to it. Hope that makes sense!