Jump to content


  • Content Count

  • Joined

  • Last visited

  1. Can I give id to PIXI.application or what is the best practice to addEventListener to canvas? document.getElementByTagName('canvas')[0] sound a bit ugly solution.
  2. Purgeri

    Level Editor?

    "more powerfull", what do you mean?
  3. Purgeri

    Game inventory

    Thank you for your advice! I have also 'Mouse' object where I handle all clicks inside canvas elements, so is it good idea to do like this: function Mouse() { var inventory = game.player.inventory; $('#inventory').click(function() { inventory.select(); } } I mean that 'var inventory...' part. Is there any better ways to do this?
  4. Purgeri

    Game inventory

    I am trying to make simple inventory for my game, but I can't decide how to do it. Now I have something like this function Game() { this.player = new Player(); } function Player() { this.inventory = new Inventory(); function Inventory() { this.items = []; this.addItem(item) { this.items.push(item); } } } Is it good idea to do Inventory object inside Player object? Or is it better to do own Inventory object and create it inside Game object like this this.inventory = new Inventory();?
  • Create New...