Santiago

Members
  • Content count

    36
  • Joined

  • Last visited

About Santiago

  • Rank
    Advanced Member

Profile Information

  • Gender
    Male
  • Location
    Argentina
  1. P2 body polygons

    Hello! I am starting to build a new stickman fight game, and I'm learning how to use P2 physics. I could find just one program to set the polygons and export it to a Json file, but is paid (PhysicsEditor). I'm looking for a free alternative, but I don't know very much about it, I tried Physics Body Editor but I didn't understand how to use it..... Does anyone knows any free license alternative or even web service? Thanks.-
  2. Can't play animations on group

    Nobody can help?
  3. Can't play animations on group

    I can't get on working some animations to a group of enemies, and I can't solve it. I could do it with a spritesheet, but with an atlas seems not working here's the code: moveEnemies: function () { for (var i = 0; i < this.enemies.length; i++) { this.enemyChild = this.enemies.children[i]; if (this.enemyChild.body.touching.down) { if (this.enemyChild.body.x < (this.player.body.x - 40)) { this.enemyChild.body.velocity.x = 100; this.enemyChild.scale.x = 1; this.enemies.callAll('animations.add', 'animations', 'enemigoAnim',Phaser.Animation.generateFrameNames('caminaE_', 1, 4), 10, true); this.enemies.callAll('animations.play', 'animations', 'caminaE_'); } else if (this.enemyChild.body.x > (this.player.body.x + 40)) { this.enemyChild.body.velocity.x = -100; this.enemyChild.scale.x = -1; this.enemies.callAll('animations.add', 'animations', 'enemigoAnim',Phaser.Animation.generateFrameNames('caminaE_', 1, 4), 10, true); this.enemies.callAll('animations.play', 'animations', 'caminaE_'); } else { this.enemies.children[i].body.velocity.x = 0; //this.enemies.callAll('animations.stop', 'animations', 'enemigoAnim') } } } }, ataquePlayer: function () { if (this.Q.justDown && game.physics.arcade.overlap(this.player, this.enemies)) { //this.player.animations.play('ataque') this.counter++ game.physics.arcade.overlap(this.player, this.enemies, function (player, enemy) { enemy.damage(25); enemy.body.drag.x = 150 if (player.scale.x == 1) { enemy.body.velocity.x = 130 enemy.body.velocity.y = -300 } else { enemy.body.velocity.x = -130 enemy.body.velocity.y = -300 } }); }
  4. Need help playing death animation

    If is useful for someone, I'm posting the solution I found: this.player.events.onKilled.add(function(){ var death = this.game.add.sprite(this.player.body.x,this.player.body.y,'vikingoAnim'); //Here I add my animation death.animations.add('death', Phaser.Animation.generateFrameNames('death_', 1, 10), 7, false); //I put the animations.play in the die variable die = death.animations.play('muerte'); //Kill animation when completes die.killOnComplete = true; }, this);
  5. Can't play animations

    I tried but seems to do nothing, it just stop for a moment the current animation (idle), but anything else, I don't know what else to do
  6. Need help playing death animation

    I've corrected my mistake in the last exists, but now it just disappear, and if I take out the if clause the behaviour is the same as recently, still there, existing. this.death= this.player.animations.add('death', Phaser.Animation.generateFrameNames('death_', 1, 10), 5, true); this.player.events.onKilled.add(function(){ this.player.exists = true; this.player.animations.play('death'); if(this.death.onComplete){ this.player.exists = false; } }, this)
  7. Need help playing death animation

    I'm doing this: this.death= this.player.animations.add('death', Phaser.Animation.generateFrameNames('death_', 1, 10), 5, true); this.player.events.onKilled.add(function(){ this.player.exists = true; this.player.animations.play('death'); if(this.death.onComplete){ this.player.exist = false; } }, this) Now the player still there, but the animation is not playing. I have corroborated that the animation is working, is there anything I'm doing wrong?
  8. Need help playing death animation

    Hello! I want to do a death animation but I can't get it, last thing I tried was using events, but I need some help here I was doing this on the create function: this.player.events.onKilled.add(function(){this.player.animations.play('death')}, this); But it seems to do nothing, would be because the sprite is already killed? I am killing the sprite by damage() method. I don't know what else to do! And I can't find anything useful on Google Hope you can help me out!
  9. Can't play animations

    I set the loop parameter to false and still replaying it, using isDown propertie, but with justDown (what I need), doesn't play it at all, still playing the idle (I think I didin't say this, I forgot it)
  10. Can't play animations

    No one can help me out?
  11. Can't play animations

    Hello, today my problem looks so stupid, but I can't find a way to solve it. I have a couple of animations that I add using: this.player.animations.add('idle', Phaser.Animation.generateFrameNames('idle_',1,4), 6, true); this.player.animations.add('ataque', Phaser.Animation.generateFrameNames('ataque_',1,2), 10, true); this.player.animations.add('daño', Phaser.Animation.generateFrameNames('daño_',1,2), 5, true); this.player.animations.add('camina', Phaser.Animation.generateFrameNames('camina_',1,5), 10, true); this.player.animations.add('muerte', Phaser.Animation.generateFrameNames('muerte_',1,10), 5, true); Everything's perfect, using this.animations,play('string') I can play it as well, but here's my problem: To make my player attack I use Key.justDown, because I want it to attack once per pressing, but if I do: if(this.Q.justDown){ this.player.animations.play('ataque'); } in this case this.Q = game.input.keyboard.addKey(Phaser.Keyboard.Q); and is the same I use to make attacks if I use the propertie isDown it plays it, but is useless for me becasue the attack have finished and the animation still looping, even if I set to false the 4th parameter of animations.add.
  12. Can't play animations

    Hello, today my problem looks so stupid, but I can't find a way to solve it. I have a couple of animations that I add using: this.player.animations.add('idle', Phaser.Animation.generateFrameNames('idle_',1,4), 6, true); this.player.animations.add('ataque', Phaser.Animation.generateFrameNames('ataque_',1,2), 10, true); this.player.animations.add('daño', Phaser.Animation.generateFrameNames('daño_',1,2), 5, true); this.player.animations.add('camina', Phaser.Animation.generateFrameNames('camina_',1,5), 10, true); this.player.animations.add('muerte', Phaser.Animation.generateFrameNames('muerte_',1,10), 5, true); Everything's perfect, using this.animations,play('string') I can play it as well, but here's my problem: To make my player attack I use Key.justDown, because I want it to attack once per pressing, but if I do: if(this.Q.justDown){ this.player.animations.play('ataque'); } in this case this.Q = game.input.keyboard.addKey(Phaser.Keyboard.Q); and is the same I use to make attacks if I use the propertie isDown it plays it, but is useless for me becasue the attack have finished and the animation still looping, even if I set to false the 4th parameter of animations.add.
  13. Group of enemies don't take damage

    That was the problem, I don't know how I've overlooked that, got to read better the API.- Thank you very much.-
  14. Group of enemies don't take damage

    Nobody can help?
  15. [Help] Sprite with solid color

    If I understand, you want to change the black background into transparent. In that case I'd use photoshop, is very easy to do it. I'd try first the background remover, setting the tolerance between 15-20% and 20 minutes (even less) of your time, you can clean all that black background.