pinkpanther

Members
  • Content Count

    22
  • Joined

  • Last visited

About pinkpanther

  • Rank
    Member

Contact Methods

  • Twitter
    maciejk71
  1. "Error: Supplied index does not exist in the child list, or the supplied DisplayObject must be a child of the caller" What's the common cause of this message?
  2. Yeah, thanks a lot, enpu :-)
  3. Hi! How to pack whole game into one game.min.js as http://www.pandajs.net/games/whackathing/? Regards!
  4. Hi, I got my sprite in separate PNG files. I want these frames to be displayed conditionally, e.g. sprite moving left - the left skew, moving right - right skew. Sometimes I want the sprite to animate (e.g. steps). Whoat should I do? Regards :-)
  5. Hi, this is the code: Score = game.Class.extend({ init : function() { this.container = new game.Container(); this.container.position.x = 0; this.container.position.y = 4 * game.system.height / 5; this.img = new game.Sprite('hit', 0, 0, { anchor : { x : 0.5, y : 0.5, } }); this.img.position.x = game.system.width / 2 - this.img.width / 2; this.img.position.y = 140; this.textBox = new ScoreText('0', 0, 0, 1); this.container.addChild(this.textBox); this.container.addChild(this.img); game.scene.stage.addChild(this.container); }, }); This gives me following errors: TypeError: child.setStageReference is not a function child.setStageReference(stage); TypeError: this.children.updateTransform is not a function this.children.updateTransform(); (repeatedly) What have I done wrong? Regards!
  6. Thanks! Worked fine for me. I added a name field and check body.name
  7. You group friendly objects (e.g.player) in one collisionGroup e.g 0; than you group enemy objects in the collision group e.g. 1. Than you set for friendly objects collideAgainst 1. In case of collision of friendly object (from group 0) against eenym object (group 1), the method collide of friendly object would be called. In this method (override) you set the sepcific action in case of this collision (e.g. removing object).
  8. Hello, I want to have many collision groups or detect, which object was collided. E.g. I need ammo box to be collided against player, which add him ammo, but when the ammo box collides against projectile, the player shouold not get ammo. Is there any way to establish more than one collision group or to detect from collide method collided object? Regards :-)
  9. Thank you! They work perfectly :-)
  10. Hello Ninjadoodle, yes, I got .fnt and .png as the result, but game hangs on loading screen, on progressbar and no messages at console at all. EDIT: it looks like it fails at : game.addAsset('xolonium.fnt'); in assets.js. If You could convert some free fonts from here: http://www.fontspace.com/category/computer eg. moonhouse, xolonium and put it here (size 48, 64) - I would like to test them.
  11. pinkpanther

    p2.js physics

    Is there any code snippet for using this plugin
  12. Hello! I created bitmap font from truetype using BMfont. Unfortuntely on initial screen the game freezes on progress bar filled ca 90 %. Nothing appears on console. What's on? Is there any way the fonts should be prepared to work properly with Panda.js? Regards!
  13. Ok, i passed timer issue, but still got the problem with references on line e = this.enemies[r]; in fallDown method. Still TypeError: undefined. I Suppose, this is due to binding in scene: this.addTimer(5000, this.enemyRow.fallDown.bind(this), true); where enemyRow is EnemyGroup class object. Important code goes here: EnemyGroup = game.Class.extend({ // enemies : [null, null, null, null, null, null, null], acceleration : 0, speed : 7, number : enemyRows * enemyCols, init : function() { var r, i; this.enemies = new Array(); // Choose start direction if (Math.random() > 0.5) { this.acceleration = 1; } else { this.acceleration = -1; } // init row of enemies for (r = 0; r <= enemyCols - 1; r++) { this.enemies.push(new Enemy(parseInt(game.system.width / 7 + r * game.system.width * 0.15), parseInt(game.system.height * 0.05), this)); // this.enemies[r].acceleration = this.acceleration; this.enemies[r].body.velocity.x *= this.acceleration; } console.log(this.enemies); // init falling game.scene.addObject(this); }, fallDown : function() { var r, i; console.log(this.enemies); for (r = 0; r <= enemyCols - 1; r++) { e = this.enemies[r]; if (e == null) continue; if (this.enemies[r] != null) { var e = this.enemies[r]; e.startfall(); } }; },
  14. Hello, what's wrong with this code: this.player = new Player(game.system.width / 2, game.system.height - this.ground.height); this.enemyRow = new EnemyGroup(); console.log(this.player); console.log(this.enemyRow); this.addTimer(5000, function() { this.enemyRow.fallDown(); }, true); That gives me TypeError (this.enemyRow.fallDown: undefined) Regards!