I collect items. But there’s a problem. I can jump on them, which is wrong. How can I not jump on them?
Preload func:
this.load.image('ball', 'assets/ball.png')
Create func:
this.balls = this.physics.add.staticGroup({classType: Ball, allowGravity: false, immovable: true })
this.balls.create(1420, 803, 'ball')
Collect func:
this.physics.add.overlap(this.player, this.balls, this.handleCollectBall, undefined, this)
handleCollectBall(player, ball) {
this.balls.killAndHide(ball)
this.physics.world.disableBody(ball.body)
}