Jump to content

Search the Community

Showing results for tags 'offCamera'.

  • 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. I'm still figuring out Phaser, and I've made a mario clone that involves shooting bullets at enemies. I'm trying to destroy the bullets after they leave the camera view, but I'm having some troubles. I have tried using bullet = bullets.create(player.x, player.y+8, 'bullet'); bullet.events.onOutOfBounds.add( goodbye, this ); function goodbye(obj) { console.log(obj); obj.kill(); } Howevery, this never fires, even after the bullet has left the camera. I think that it might be because my world bounds are much larger than the camera is, so I tried making a function to destroy the bullets after they leave the camera like this: function checkBullet(){ bullets.forEach(function(item) { if(item.inCamera===false){ item.kill() } });} However this kills the bullets immediatly, which I also don't want. Is there a better way that I can go about this that will actually work?
×
×
  • Create New...