phaserly Posted July 7, 2018 Share Posted July 7, 2018 Hi, I have the code to pick up a ball with the overlay event. // in the game.js this.physics.add.overlap(this.ballGroup, this.player, this.ballGroup.collectBalls.bind(this.ballGroup)); // in the ballGroup.js collectBalls (player, ball) { if(player.balls >= 3 || ball.active === false) return; ball.active = false; ball.visible = false; // player.balls++; } Now i want to stick the ball/image to the player as a 'weapon'. In other words, how to i attach a sprite to another sprite. Thanks in advance! Link to comment Share on other sites More sharing options...
Recommended Posts