Jump to content

Search the Community

Showing results for tags 'bullets'.

  • 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
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

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 13 results

  1. Hello! According to the examples I've created a tilemap from JSON file and added firing bullets with a left mouse clicking in a cursor's direction. Also a platform was added. My problem is that there are no collisions detected between a bullet and a tilemap's objects. But collisions works fine between the bullet and a platform. Here is my demo code: var config = { type: Phaser.CANVAS, width: 800, height: 600, backgroundColor: '#2d2d2d', parent: 'phaser-example', physics: { default: 'arcade', arcade: { gravity: { y: 300 },
  2. I have done a demo code that creates a gun (blue box) and bullets (red boxes). How can I set the initial position of the bullets depending of the rotation of the gun? Said with other words, if I rotate the gun (left/right arrows) , the bullets keep coming from the top side of the gun (box) instead of rotating accordingly. Code: http://plnkr.co/edit/3evg6J2cGo0nS7QKxiak?p=preview Preview: http://run.plnkr.co/AodG3n4Ykb3osdh2/
  3. Hello, I created weapon animated from a spritesheet however the images on the sheet where a bit oversized. I know I can make the spritesheet smaller but it kindoff defeats my purpose of learning more in programming;) So when I scaled the weapon itself (fireball) to be half its sprites size its starting position also changed. Therefore I figured I' d anchor the weapon in the right position. But for some reason it keeps stating " anchor = undefined". So, anyone sees whats going wrong here? //This line is the one bugging out. I tried setting the anchor on each bullet and on
  4. Hi there, I want to build a shotgun weapon for my game. This shotgun would shoot 3 (or more) bullets in a conical angle. However, from what I see, Phaser.Weapon only fires one bullet at a time. What do I do in order to get the weapon to fire 3 bullets consecutively
  5. So I'm currently following @rich 's Shoot-em-up tutorial from over here https://phaser.io/tutorials/coding-tips-007. Please have a look at the source code if you haven't already. From what I understand he create's a weapon array that holds all the weapon types (each of which are an object inside a Weapon object). Now my question is How do I access the current weapon bullets in game.physics.arcade.collide? I've used game.physics.arcade.collide(this.weapon[this.currentWeapon], this.enemies) and this works fine, the bullets and the enemy collide well. BUT what if I wan
  6. Hi there, I'm creating a simple platform game where you can shoot enemies. I've applied game.physics.arcade.gravity.y = 1000; But this seems to now affect my weapon class and bullets too! How do I set my weapons or bullets to NOT be affected by gravity? Here's the code I've used for reference: var playState = { //code to make assets goes here create: function(){ /*-- creating player --*/ game.add.sprite(0, 0, 'background'); game.physics.arcade.gravity.y = 1000; //Do not enable, need to fix gravity. this.player = game.ad
  7. Hey everyone! So I'm pretty new to Phaser and I'm having a hard time making the player's bullets stop at a certain point (e.g killing the projectile at around 30px after its original position, etc). I want the player to have a limited projectile range and I'm just wondering how you can implement that because all my attempts of trying to figure it out have failed so far, so I'm seeking help from you guys... Thanks for any advise!
  8. This seems like a simple z-order or positional issue. But I have a simple top down shooting example, and I want to have a player at the bottom which can rotate in place and shoot. Now overall the example is working. But the problem I'm having is the bullets are above the player sprite location. In my test case, I have boxes, and the bullets are originating from the center anchor point of my sprite. I'm trying to figure out how I can hide that by moving the player above the bullets, or if possible reposition the firing to the front of the player. My initial test was to adjust the Y, but that do
  9. I want to scope after clicking the mouse flew in the direction of movement of the camera, thus emulated shot. Possible example on three.js: http://pauluskp.com/cannot My attempt to do so at Babylon: http://www.babylonjs-playground.com/#VWXHP#1 Here is the basic code, then I created a sphere when clicked, and then later in scene.registerBeforeRenderthe set coordinates camera adding a constant but probably incorrectly specified coordinates. window.addEventListener("click", function (e) { var bullet = new BABYLON.Mesh.CreateSphere('bullet', 3, 0.3, scene); var pos = camera.pos
  10. I know you guys have seen a million of these before. I have read a couple of responses to older posts, checked the examples, and found other demos where what I am trying to do is working. Basically what I am seeing is, if there is only one bullet on the screen then when that bullet hits the player on the right it dies. However if there is more than one bullet then the last bullet fired is killed and the others just pile up. You can see it in action here: http://thedatacloset.com/project/ WASD moves the player on the right, while SHIFT shoots. Arrow keys move the player on the left, wh
  11. Hello! I've been playing around with the source code of the phaser example game called Tanks (http://examples.phaser.io/_site/view_full.html?d=games&f=tanks.js&t=tanks). However I have not figured a way to make the tanks target and shoot at the other tanks, so I would appreciate help. There is a line of code for the EnemyTank function to target the player: bullet.rotation = this.game.physics.arcade.moveToObject(bullet, this.player, 500); This makes the bullet fired by an EnemyTank function prototype go to towards the player's tank. I've been trying to figure out a way to
  12. How would one go about destroying a specific entity in an array? I have tried destroy, I have tried setting the object equal to null, but nothing has helped. After about 400 enemy ships spawn the game just lags. Any advice?
  13. Hi. I'm trying to make my jet shoot red bullets, but for some reason they're coming out at green. Here's my code.... function Jet() { this.srcX = 0; this.srcY = 510; this.width = 100; this.height = 40; this.speed = 3; this.drawX = 220; this.drawY = 200; this.noseX = this.drawX + 100; this.noseY = this.drawY + 30; this.isUpKey = false; this.isRightKey = false; this.isDownKey = false; this.isLeftKey = false; this.isSpacebar = false; this.isShooting = false; this.bullets = []; this.currentBullet = 0; for (var i = 0; i < 25; i++) { th
×
×
  • Create New...