# frank84

Members

6

• Rank
Newbie
1. ## How can I calculate the distance a sprite will travel with velocity?

Wow that's exactly what I was looking for, thanks a lot for that! I'll be sure to look into that and see how they do it, hopefully I can tweak it to adapt it to my game
2. ## How can I calculate the distance a sprite will travel with velocity?

Yeah unfortunately I need to use physics . What I want to do would be very similar to the effect found in Angry Bird, where you can see a curved line over the bird when you are about to throw the bird, and that line give you an idea where your bird will land.
3. ## How can I calculate the distance a sprite will travel with velocity?

Ok i'm kind of stuck here ... I have a a sprite that I move using the following: target.sprite.body.velocity.x += target.power/2;target.sprite.body.velocity.y -= target.sprite.body.velocity.x*1.5;I would like to know the coordinates of where the sprite will stop instantly, without having to wait for the animation of the sprite to finish. Anyone knows how I could achieve that? Thanks!
4. ## How to change the color of a rectangle

Awesome thanks guys
5. ## How to change the color of a rectangle

Hello there, I'm just starting with Phaser, so sorry about this very basic question. I can't seem to successfully update the color of a Rectangle. Here is my code so far: // drawing playerthis.player1 = new Player(0, 20, "0xFFFF33");this.player1.graphic = this.game.add.graphics(this.player1.size,this.floor.base-this.player1.size); this.player1.graphic.beginFill(this.player1.color, 1);this.player1.graphic.drawRect(0, 0, this.player1.size, this.player1.size); update: function() { this.player1.graphic.graphicsData[0].fillColor = this.player1.breakdown ? '0XFF0000' : '0XFFFF33'; } The following do update the color, but I need it to change only when certain conditions are met: update: function() { this.player1.graphic.graphicsData[0].fillColor = '0XFFFF33'; } There is probably a method I can call to update the color, but looking at Phaser/Pixi docs I can't seem to find anything. Thanks for your help!
6. ## generator-phaser-official: Yeoman Generator for Phaser projects

I'm just starting looking into Phasing and that is exactly what I was looking for, thank a lot!