Jump to content

Search the Community

Showing results for tags 'weapon plugin'.

  • 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 2 results

  1. Hi everyone, I'm following a tutorial about creating a shoot 'em up with Phaser but I got stuck when creating a power up that allows you to shoot multiple bullets at a time. As Richard Davey says it should be as simple as calling the .fire() method multiple times but it doesn't work, only the first call to .fire() gets executed no matter what. Here's my code: for ( var i = 0; i < this.weaponLevel; i++ ) { // Left bullets var left = new Phaser.Point(this.player.position.x - 10*i, this.player.position.y - 20); this.weapon.fireAngle = -95 - i*10; this.weapon.fire(left); // Right bullets var right = new Phaser.Point(this.player.position.x + 10*i, this.player.position.y - 20); this.weapon.fireAngle = -85 + i*10; this.weapon.fire(right); } I've googled a lot and unfortunately I found nothing. Thanks in advance.
  2. I am using Phaser 2.5.0 and using the weapon plugin that comes with it. I been trying for a week to get my bullet for my game to be killed or destroyed when it hits a meteor. So far I have been only been able to kill the meteor. Below is the code from my game state that includes my weapon and the meteors MeteorCrisis.StateGame = function(game) { //Variables var meteors; var weapon; }; MeteorCrisis.StateGame.prototype = { create: function() { this.physics.startSystem(Phaser.Physics.ARCADE); //Player Laser Gun weapon = this.add.weapon(-1, 'laser'); weapon.bulletKillType = Phaser.Weapon.KILL_WORLD_BOUNDS; weapon.bulletSpeed = 600; weapon.fireRate = 400; //Meteors meteors = this.add.group(); meteors.enableBody = true; meteors.physicsBodyType = Phaser.Physics.ARCADE; this.time.events.loop(1400, this.createMeteor, this); }, createMeteor: function() { var meteor = meteors.create(800, this.world.randomY - 40, 'meteor'); }, update: function() { //When a bullet collides with a meteor this.physics.arcade.overlap(weapon.bullets, meteors, this.laserHitMeteor, null, this); }, //This is the function that is called when the bullet hits the meteor laserHitMeteor: function(meteor, meteor) { meteors.remove(meteor, true); } }; I used meteor twice because weapon.bullets would break my game state. Any help on how I wrote my functions wrong or how to kill or destroy the bullet would be greatly appreciated!
×
×
  • Create New...