Jump to content

Search the Community

Showing results for tags 'sprite remove sprite'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. Hi! I'm a newbie in HTML5 and panda.js. How will I remove a sprite on collide. I am studying your sample game Flying dog, and I would like to place an image on your goalBody with a Sprite. (Just like what you did on topSprite and bottomSprite). But I am having an error if I add this code on collide. this.goalSprite = new game.Sprite(game.system.width + this.width / 2 + this.width + game.scene.player.body.shape.width, topHeight + this.height / 2, 'media/someimage.png', { anchor: {x: 0.5, y: 0.5}, });game.scene.goalContainer.addChild(this.goalSprite);this.goalBody.collide = function() { game.scene.world.removeBody(this); game.scene.goalContainer.removeChild(this.goalSprite); //this is the line I added game.scene.addScore(); return false; };Error:Uncaught Error: undefined The supplied DisplayObject must be a child of the caller [object Object] Am I doing it right? Or is there better approach on this? BTW, Panda.js is really amazing... Thanks,
×
×
  • Create New...