roycocup Posted May 26, 2016 Share Posted May 26, 2016 Hi Guys, I have been battling with this for some time now. I'm kinda newbie with phaser too. Currently I'm trying to build a football game where the player adds the ball (both are sprites) to his own sprite and moves around with it until is moment to "kick" the ball, sending it in any direction. My problem is that I can't seem to be able to release the ball once its been attached. I tried "moveToXY" or "AccellerateToXY" but nothing seems to be doing it. I also tried bypassing the collision "attach" behavior as it seems that it may be a problem but I dont think that is the problem, unless someone tells me otherwise. Here's a screenshot of the game so you can have better context . How can I release the ball from the sprite and send it on a given direction? What do you think is the problem? ... kick: function(direction, speed){ var ball = this.sprite.getChildAt(0); this.sprite.removeChildAt(0); game.physics.arcade.moveToXY(ball, direction.x, direction.y, speed); this.possession = false; }, ... Link to comment Share on other sites More sharing options...
roycocup Posted May 27, 2016 Author Share Posted May 27, 2016 Well.... Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts