Search the Community

Showing results for tags 'destroy'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser
    • Pixi.js
    • Babylon.js
    • Panda.js
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 36 results

  1. Hello, 1. I created a group groupA in the game. 2. I created a sprite spriteA and added it to groupA. 3. After that I kill() spriteA and keep its reference in a pool array for later use. 4. I destroy() groupA. 5. I get the spriteA from the pool array to be used in another group and try to change its texture with loadTexture(), I get error: phaser2.8.8.js:46794 Uncaught TypeError: Cannot read property 'cache' of null at Phaser.Sprite.loadTexture (phaser2.8.8.js:46794) That doesn't happen if I don't destroy the group in step 4. Could anyone please explain what is going on and what is the right way to reuse Sprites even when their container parents are destroyed?
  2. Hi I'm new to Phaser, so please forgive that I also posted to the Google Group on this subject. I'm not yet sure where it's best to ask this kind of question. I am developing a SPA with Angular2 and so am playing with Phaser 3 as it's modularity seems to enable it to be used with Angular2. I need to be able to load a game, then close it, then load a new game in it's place. What is the proper way to "destroy" a Phaser 3 game please? I note that there is a destroy method in src/scene/System.js as per the attached image. I notice the "TO DO" so it may be that this is just not implemented yet? Any thoughts or feedback would be very welcome. Thanks so much! Dougi
  3. Hello there, I'm trying without success to find all stages and renderers that PIXI has in memory, so I can call destroy on them and their children. I'm sure there is a way to have that so I don't have to keep track on my application. It is a React website and therefore the component that had that reference is unmounted and then mounted again later on. When I instantiate a new stage and renderer, I can see them piling up and using a lot of memory as I go from one part of my website to another. How could I find all instances so I destroy them before creating new ones? I have the global PIXI object on window... Thanks a lot!
  4. I'm making a simple bug-catching game where the main character catches the bugs using the kill() function when they overlap. It's working, except that he can bounce on the bugs. How can I stop him from being able to bounce on them? The update function looks like this: game.physics.arcade.overlap(this.player, this.fireflies, this.takeFirefly, null, this); and the takeFirefly function looks like this: takeFirefly: function(player, firefly) { firefly.kill(); score++; this.txtScore.setText( score.toString() ); }, main.js
  5. Hi! I'm having trouble with destroying the game after use. I'm calling game.destroy(), but this does not properly shut down the core game loop, hence crashing in: c.Game.updatec.RequestAnimationFrame.updateRAFwindow.requestAnimationFrame.forceSetTimeOut._onLoopwith the error: Uncaught TypeError: Cannot read property 'slowMotion' of nullFrom the source code it looks like game.destroy() should cancel all further updates etc. Maybe I'm missing something?
  6. Hi all, I'm trying to use Slick UI to dynamically create multiple choice question prompts in a new game (see image). The problem is, there doesn't seem to be a way to remove a panel, or update its child elements once they have been created. I couldn't find a way to do this directly through Phaser either. Any help greatly appreciated. Perhaps there is a Phaser method to destroy all children generated by a particular plugin? Cheers, Paul.
  7. Destroy Emitter Particle on Click

    Hi all, this is my first post here. I have created a game with emitter particles that flow up from the bottom of the game canvas. My question is I want to destroy the partial (sprite) onClick which will in turn give a set value to the score. I cannot for the life of me work out how to destroy the particle on click. any help would be greatly appreciated as I cannot find any documentation specifically for this. Any advice would be greatly appreciated, as I am unsure if the emitter is the best way to achieve what I want. emitter = this.emitter = this.game.add.emitter(this.game.world.centerX, this.game.world.centerY); // This emitter will have a width of 800px, so a particle can emit from anywhere in the range emitter.x += emitter.width / 2 emitter.width = 900; emitter.height = 200; emitter.y = 1200; emitter.makeParticles('key'); emitter.minParticleSpeed.set(0, 10); emitter.maxParticleSpeed.set(0, -80); emitter.setRotation(20, -60); emitter.setAlpha(1, 1); emitter.setScale(1,1, 0.5, 0.5); emitter.gravity = 0; emitter.flow(4000, 100, 100, -1); // This will emit a quantity of 5 particles every 500ms. Each particle will live for 2000ms. // The -1 means "run forever" emitter.start(false, 4000, 500, 15, true);
  8. Destroy Object Bug

    Hey everybody, First of all big thanks to Pixi.js people for the awesome library. I have been using Pixi to develop a simple game and I stumble upon a small bug or I may be doing this wrong. So here is the problem, I got a sprite which contains child's sprites. And I want to destroy it but not the children since I was handling it manually because I need to save the state of each child sprite and then call destroy within them self. So before I calling destroy method I call a custom method on my object, deletingObject.onDestroy(); and then call deletingObject.destroy({ children: false, texture: false, baseTexture: false }); but this still destroys all the child within this object, I'm using https://cdnjs.cloudflare.com/ajax/libs/pixi.js/4.1.1/pixi.min.js as my Pixi version. and I have attached a screen shot from core developer tools. Am I doing the function call wrong or is there something missing. Thanks.
  9. destroy() on group children error

    hello, I have an error when using destroy() on group.children[0] function create() { boomerangBullets = this.game.add.group(); boomerangBullets.enableBody = true; boomerangBullets.physicsBodyType = Phaser.Physics.ARCADE; boomerangBullets.setAll('checkWorldBounds', false); boomerangBullets.setAll('outOfBoundsKill', true); } function update() { if(game.physics.arcade.distanceBetween(player, boomerangBullets.children[0]) < 30) { boomerangBullets.children[0].destroy(); } } here is an error screenshot --> http://prntscr.com/cnea7s Please help me, the kill() method is working fine but I need to completely destroy the group children element.
  10. Properly Destroy a Group

    I simply want to know the best approach for destroying a group and everything within the group. According to the documentation: destroy(destroyChildren, soft) Destroys this group. Removes all children, then removes this group from its parent and nulls references. Unfortunately, I'm still finding that my references return an object - not null or undefined For reference, here is a simplified look at the object I'm trying to destroy: class MyObject extends Phaser.Group { constructor(game) { this.game = game; // Creating Phaser sprites and adding them to group } destroyObject() { this.destroy(); } }
  11. https://github.com/pixijs/pixi.js/issues/2958 Warning! Your TAB in browser will freeze.
  12. Triggering onDestroy

    I'm having a hard time triggering onDestroy for my FreezeEffect object. I've essentially set up an object that destroys itself after a few seconds. I've tested and confirmed that "destroyObject" is being called. But sometimes the game ends, the state transitions in the middle of the FreezeEffect, and the "onDestroy" method is never called. I was under the assumption that calling state.start('newState') destroys the Phaser objects in the previous state. Is that not true? Example code: // Freeze Effect FreezeEffect = function (game) { ... constructor code ... ... create tween to fade freeze effect ... // Call function to destroy the freeze effect when the tween finishes tween.onComplete.add(this.destroyObject, this); // Slow down time game.time.slowMotion = 2.0; }; FreezeEffect.prototype = Object.create(Phaser.Group.prototype); FreezeEffect.prototype.constructor = FreezeEffect; FreezeEffect.prototype.destroyObject = function() { // Put time at normal speed this.game.time.slowMotion = 1.0; this.parentGroup.destroy(true, false); this.freezeSFX.destroy(); // Destroy the object and free memory this.destroy(true, false); }; FreezeEffect.prototype.onDestroy = function() { // Put time at normal speed this.game.time.slowMotion = 1.0; }
  13. How to destroy Phaser game properly

    I guess this is not a problem if you just reload a page, but my website changes routes without reload. I have a Phaser game running on a page, when I visit another page, I noticed game is still running. I never had to think about how to destroy the game properly since now. How do I destroy a Phaser game, what callbacks are fired and what else do I have to do, to properly destroy a Phaser game.
  14. I'm trying to remove sprites from a group using destroy() whenever the sprite goes out of the world bounds, but I'm getting an unexpected error: Cannot read property 'world' of null. Any idea why this is happening? function create() { buildings = game.add.group() var building = buildings.create(0, 0, 'building') building.body.velocity.y += 90 building.events.onOutOfBounds.add(onBuildingOutOfBounds, this)}function onBuildingOutOfBounds(building) { building.destroy() console.log(buildings.length)}
  15. Hi I was wondering if I should explicitly destroy all the tweens that I create? I am moving objects on screen every few seconds with one time tweens like so: this.state.add.tween(child).to({ y: prevY + this.blockHeight }, 300, Phaser.Easing.Quadratic.In, true)is it destroyed automatically after the tween is completed or should I destroy it? thanks Lior
  16. When trying to clean up my stage on game over, I loop through my game object groups and destroy all children inside explicitly. Then I destroy the (now empty) groups: cleanGroup(Grp1); // Grp1 is child of Stage groupcleanGroup(Grp2); // Grp2 is child of Stage groupcleanGroup(Grp3), // Grp3 is child of Stage groupcleanGroup(Stage);var cleanGroup = function(Grp) { if (Grp.children) { while (Grp.children.length) Grp.removeChildAt(0).destroy(); } Grp.destroy(); }However, this always gives me a hole bunch of error messages like: this.children is null this.parent is null o is null The error messages are constantly repeating as if it where within a loop anywhere inside the Pixi render enginge. Why is this and how could this be solved? Do I need to destroy my created sprites and groups at all or is it enough just to remove all of my references to them and let the garbage collection do the rest? Would this be reliable?
  17. Hello, I've got a strange error. I've got a quitting menu in my game which basically ask you if you want to quit or not when you click on a button (that part works fine). If ever you answer "Nope" then I will destroy without any mercy all sprites that were used to buld the quit menu (that part kinda works but wait for it...). Problem is if you can't set your mind and you click that quitting button once again, and decide to say no a second time (why would you even do that I don't know but...) and at that point no sprites are destroyed (none, not even one) but the game unpause for the rest of it and there's menu bits in the game (great T_T). Also it throws an error at the 8th element (it doesn't destroy any of the first seven ones though) which is : "Uncaught TypeError: Cannot read property 'parentNode' of null". I've tried real hard to understand this but I don't. Why the hell does it works once and not twice? Here's some code : Quit Menu code : quitButton = game.add.sprite(SIZE_X * 0.03, SIZE_Y * 0.03, 'quit'); quitButton.inputEnabled = true; quitButton.events.onInputUp.add(function () { var darkScreen; var exitButton, exitButtonText, exitButtonHitBox; var unpauseButton, unpauseButtonText, unpauseButtonHitBox; var showQuitMessage; var quitTitleSprite, quitMessageSprite; // Pause game pauseGame(game, gameBoard); miniature.inputEnabled = false; quitButton.inputEnabled = false; onMenu2 = true; // prevents the miniature and the quit button from poping on top of the darkened screen // darken screen (black transparent sprite of the size of the screen) darkScreen = game.add.graphics(0, 0); darkScreen.beginFill(0x000000, 1); darkScreen.alpha = 0.5; darkScreen.drawRect(0, 0, SIZE_X, SIZE_Y); // White box showQuitMessage = game.add.graphics(0, 0); showQuitMessage.beginFill(0xFFFFFF, 1); showQuitMessage.drawRect(SIZE_X * 0.2, SIZE_Y * 0.15, SIZE_X * 0.6, SIZE_Y * 0.7); // Text output quitTitleSprite = game.add.text(SIZE_X * 0.4, SIZE_Y * 0.3, quitTitle, {font: 'bold ' + Math.floor(SIZE_Y / 15) + 'pt Arial', fill : '#000'}); quitMessageSprite = game.add.text(SIZE_X * 0.325, SIZE_Y * 0.45, quitMessage, {font: Math.floor(SIZE_Y / 30) + 'pt Arial', fill : '#000'}); // exitButton && unpauseButton graphics exitButton = game.add.graphics(0, 0); exitButton.beginFill(0x81DEED, 1); exitButton.drawRect(SIZE_X * 0.35, SIZE_Y * 0.65, SIZE_X * 0.1, SIZE_Y * 0.06); exitButtonText = game.add.text(SIZE_X * 0.38, SIZE_Y * 0.665, quitButton1Text, {font: Math.floor(SIZE_Y / 40) + 'pt Arial', fill : '#000'}); unpauseButton = game.add.graphics(0, 0); unpauseButton.beginFill(0x81DEED, 1); unpauseButton.drawRect(SIZE_X * 0.55, SIZE_Y * 0.65, SIZE_X * 0.1, SIZE_Y * 0.06); unpauseButtonText = game.add.text(SIZE_X * 0.58, SIZE_Y * 0.665, quitButton2Text, {font: Math.floor(SIZE_Y / 40) + 'pt Arial', fill : '#000'}); // exitButton && unpauseButton clicking gestion unpauseButtonHitBox = new Phaser.Rectangle(SIZE_X * 0.55, SIZE_Y * 0.65, SIZE_X * 0.1, SIZE_Y * 0.06); exitButtonHitBox = new Phaser.Rectangle(SIZE_X * 0.35, SIZE_Y * 0.65, SIZE_X * 0.1, SIZE_Y * 0.06); game.input.onDown.add(function(pointer) { if (onMenu2) { if (unpauseButtonHitBox.contains(pointer.x, pointer.y)) { unpauseGame(game, gameBoard, 2, showQuitMessage, unpauseButton, exitButton, darkScreen, quitTitleSprite, quitMessageSprite, unpauseButtonText, exitButtonText); miniature.inputEnabled = true; quitButton.inputEnabled = true; } else if (exitButtonHitBox.contains(pointer.x, pointer.y)) location.reload(true); } }); });Pausing function : function pauseGame(game, gameBoard) { for (var i = 0; i < NB_CELL_Y; i++) { for (var j = 0; j < NB_CELL_X; j++) { gameBoard.puzzle[i][j].sprite.inputEnabled = false; } } }Quitting the quitting menu code (or unpause function) : // After the menu argument, all args must be sprites and they will all be destroyed function unpauseGame(game, gameBoard, menu) { var i; if (menu == 1) // full picture Menu onMenu = false; // useful for stopping some sprite events, and starting others else if (menu == 2) // exit Menu onMenu2 = false; // Allows the sprites to be moved again if (onMenu == false) // the game can't go back to it's normal behavior if we're still on the full picture menu { for (i = 0; i < NB_CELL_Y; i++) { for (var j = 0; j < NB_CELL_X; j++) { gameBoard.puzzle[i][j].sprite.inputEnabled = true; } } } // deletes the sprites that made the menu for (i = 3; i < arguments.length; i++) { console.log("arg["+i+"] destroyed."); arguments[i].destroy(); } }Here's the console log : inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startpuzzle_plus.js:316 arg[3] destroyed.puzzle_plus.js:316 arg[4] destroyed.puzzle_plus.js:316 arg[5] destroyed.puzzle_plus.js:316 arg[6] destroyed.puzzle_plus.js:316 arg[7] destroyed.puzzle_plus.js:316 arg[8] destroyed.puzzle_plus.js:316 arg[9] destroyed.puzzle_plus.js:316 arg[10] destroyed.phaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled false d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: true, priorityID: 0, useHandCursor: false…}phaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}_dragPoint: d.Point_pointerData: Array[10]_tempPoint: d.PointallowHorizontalDrag: trueallowVerticalDrag: trueboundsRect: nullboundsSprite: nullbringToTop: falseconsumePointerEvent: falsedragFromCenter: falsedragOffset: d.Pointdraggable: trueenabled: truegame: d.GameisDragged: falsenext: d.InputHandlerpixelPerfect: falsepixelPerfectAlpha: 255prev: d.InputHandlerpriorityID: 0snapOffset: d.PointsnapOnDrag: falsesnapOnRelease: falsesnapX: 0snapY: 0sprite: d.SpriteuseHandCursor: false__proto__: Objectphaser.min.js:6 InputHandler startphaser.min.js:7 inputEnabled true d.InputHandler {sprite: d.Sprite, game: d.Game, enabled: false, priorityID: 0, useHandCursor: false…}phaser.min.js:6 InputHandler startpuzzle_plus.js:316 arg[3] destroyed.puzzle_plus.js:316 arg[4] destroyed.puzzle_plus.js:316 arg[5] destroyed.puzzle_plus.js:316 arg[6] destroyed.puzzle_plus.js:316 arg[7] destroyed.phaser.min.js:7 Uncaught TypeError: Cannot read property 'parentNode' of nullActually I'm talking of sprite but there's some text and graphics too, but since it works the first time I guess ."destroy()" works on them too. If you neef any more info I'll be glad to give it, sorry if I'm not very precise and for the high number of lines of code. Thanks in advance! Stupid PS : Is it me or does Syntax Highlighting in the code balise has a serious problem (or more precisly is inexistant).
  18. For example: ...var slide_container_4 = new PIXI.container();var texture = PIXI.Texture.fromVideo(url);var video = new PIXI.Sprite(texture);slide_container_4.addChild(video);...How to destroy video from memory?
  19. Hello, I noticed that events attached on bitmapText objects tend to linger/persist even after the item has been removed/destroyed from the group or even after the group has been destroyed. Does anyone have any idea why is this happening? or how to solve this? I'm attaching the event like this text.inputEnabled = true;text.events.onInputDown.add(fn, this);Thanks!
  20. Automatic destroy of local tween

    Can someone please let me know what happens to the local tween when it has finished its tween? TweenOutIngredients: function () {var tweenTray = this.game.add.tween(this.ingredientsTrayGroup); tweenTray.to({x: -900}, 300, Phaser.Easing.Back.In, true); tweenTray.onComplete.addOnce(function(){ this.ResetIngredients(); }, this);},I'm worried if this local tweenTray object will not be picked up by Garbage Collector and will cause memory leak. Also, is there a recommended way to test for memory usage? When making AIR applications, we can just fire up Task Manager and look at adl.exe, I'm not sure how I look it up in Phaser Thanks!
  21. How to destroy a fucntion?

    I want to destroy a function, what is the best way to do that? example : FavoriteFlavor.bootState = { button: function(btnX, btnY, textX, textY, fn, text) { var button = game.add.button(game.world.centerX + btnX, game.world.centerY + btnY, 'btnLetGo', fn, this); button.anchor.set(0.5); button.input.useHandCursor = true; var letGo = game.add.text(game.world.centerX + textX, game.world.centerY + textY, text); letGo.font = 'Arial'; letGo.fill = '#ffffff'; letGo.fontSize = '13px'; letGo.align = 'center'; letGo.fontWeight = 'bold'; letGo.anchor.set(0.5); }};FavoriteFlavor.gameState.prototype = { create: function() { button = FavoriteFlavor.bootState.button(0, 130, 0, 130, this.start, "Start"); }, start: function() { //click start function destory FavoriteFlavor.bootState.button //how to do that? }};
  22. Remove object in group after delay?

    I already know how to destroy a group object when it collides with something else. However, I can't seem to find a way to delay the destruction of the object after the collision. The following code works for instantly destroying the otherThing in the otherThings group that the thing object overlaps: game.physics.arcade.overlap(thing, otherThings, removeOtherThing, null, this);function removeOtherThing (thing, otherThing) { otherThing.destroy();}What I want to do is delay the destruction of the otherThing object by an arbitrary amount. I can't seem to find a way that works, though, with the methods I've tried so far returning errors. Help would be appreciated!
  23. Hello friends, First, as usual, excuse me for my english, I need destroy a object (from a class) at the time when the sprite asociated (property of the object) is delete (with kill()) How I can do? Example: var obj = new ObjClass(); //obj.objectSprite is a property (a Sprite) function update(){ game.physics.aracade.collide(obj.objectSprite, otherSprite, destroyObject, null); } function destroyObject(){ obj.objectSprite.kill(); //Here, I want to destroy the object that has 'this.objectSprite' as property (or attribute) //The natural solution is do obj = null }
  24. destroy animation when finished

    I want to make an animation when you take a coin, and when the animation is complete, this animation is destroyed, not consuming resources. I've done that take the currency disappears, then appears the animation, but not destroyed after running animation ... I have the following code: var anim = game.add.sprite(coin.x, coin.y, 'coin'); anim .animations.add('walk'); anim .animations.play('walk', 20, false);
  25. Hi, I have just created a simple game based on the Phaser examples. Here is the source: http://jsfiddle.net/Lajk6trp/ On "RESET" button : - we destroy the old game if any - we generate a new game with two dragable elements (elements images are not available in the example, but it doesn't matter). This code is working on a desktop. But when I test on IOS device, the game is working only the fourth first times. At the fifth click on "RESET", elements are shown, but there are no more dragable. Weird behavior :-o I log the "game" var in console. I can see the var is already a game object after destroyed. Is it normal? It seems weird to have a good behavior creating the game and its elements each time we push on RESET, but to have the dragable event broken on the fifth click. Any help? Note: don't take care of Loader. It's just a test and does not affect the destroy method().