Jump to content

Drewrg

Members
  • Content Count

    10
  • Joined

  • Last visited

Everything posted by Drewrg

  1. Hello everybody. I am trying to optimize my game, and would like to know, which of this two Phaser techniques would be more optimal in term of resource usage. On one side I got SpriteSheet - 'atlasJSONHash'. // preload game.load.atlasJSONHash('image', 'assets/image.png'); // create var foo = game.add.sprite(0, 0, 'image'); foo.animation.add('main'); foo.animation.play('main', 30, true); On other side I got just a sprite with a texture, and I'm changing it's texture in the Phaser render function, with another preloaded texture. // preload var textureAr
  2. I would like to, but createPattern will not work in my case, it has lack of properties. I can't position, or modify width and height of source image.
  3. Actually there will be drawImage() instead of fill(), but drawImage() got the same issue, Is there any idea, what can replace drawImage().
  4. The Example. Hello every body. I have a Canvas with red background. On it I have rows of boxes, which go exactly after each other. Each box begins exactly where previous box ends, and they all have same skew. So there should not be any gap between edges, but as you can see in the example there are gaps. Does anybody knows why is this happening, and how to get rid of it. console.clear(); var canvas = document.getElementById('canvas'); var ctx = canvas.getContext('2d'); var world = { centerY: canvas.height / 2, centerX: canvas.width / 2 } var rowCount = 14; var box
  5. Hi everybody, I got an issue with PhaserJS rope. I need to animate rope with spritesheet. The objective is to make curved / bent spritesheet animation. I tried almost everything but it won't render correctly. All I got is single frame being rendered, although I can see animation frames, and loop count in console log. I need to curve / bend sprite sheet animation,it is not necessarily need to be done by rope, any solution would be great. Will be grateful for any suggestion, thank you in advance.
  6. Hello @LuizOtavio I used. this.weapon.bullets.setAll('anchor.y', 1); This is worked for me so far. For the bullet speed, I am using Phaser.Physics.arcade.overlap(bulletsGroup, target, function); which is returning the bullet that were collided.
  7. Thank you for reply, I've rotated the actual png image itself, and that solved the wrong direction of fire. But anyway I still can't adjust speed and anchor of particular bullets. As you can see in gif, the position of weapon is correct, but bullets anchor point is incorrect.
  8. Hello! I'm having a hell of a time trying figure out how to change Phaser Weapon plugins bullet speed after it's been shot. I also set "weapon.bulletSpeed" negative value, because by default it was going in opposite direction. I attached weapon to a spaceship sprite, but on "weapon.fire()" bullet goes backwards. Weapon definition. addWeapon: function(target) { var weapon; var weapon; weapon = game.add.weapon(100, 'bullet'); weapon.bulletKillType = Phaser.Weapon.KILL_WORLD_BOUNDS; weapon.bulletAngleOffset = 90; weapon.bulletSpeed = 5; weapon.trackSprite(target, (
×
×
  • Create New...